# Addition of a methyl group to a heterobicyclic ring [closed]

I am battling to understand how this reaction works. It should be a carbonyl addition reaction but I am not 100% sure how to reach each step. Could someone explain the mechanism to me?

## closed as off-topic by Gaurang Tandon, Todd Minehardt, aventurin, airhuff, DrMoishe PippikMar 22 '18 at 18:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Here, the lone pair on $\ce{N}$ is in conjugation with the double bond.So, during formation of the first product, the lone pair delocalises and as a canonical form, a carbanion is formed which acts like a Nucleophile and performs $\ce{S_N2}$ with $\ce{CH_3I}$.
For the formation of the next two products, $\ce{K_2CO_3}$ acts like a base and abstracts a proton from the methyl substitued carbon. That abstraction forms a carbanion which is also in conjugation with a double bond and hence it's stable. The next two products are actually both $\ce{S_N2}$ products, but the nucleophilic centre are change due to that negative charge delocalisation.