Friedel-Crafts alkylation is prone to carbocation rearrangement. In this case, alkylation produced a 1º carbocation which rearranged to a 3º carbocation, leading to compound B.
We can avoid this by instead doing Friedel-Crafts acylation. The intermediate in acylation is the acylium ion, which is stabilized by resonance and so won't rearrange.
But after the acylation reaction we have to get rid of the carbonyl (C=O) group, so we do a Wolff-Kishner reduction (N2H4/NaOH, heat).