Question

I know this is turning into a ring because it is reacting with itself but I'm confused why in the answer a methyl group will be coming off the 5 member ring

enter image description here