The problem is such:
[![enter image description here][1]][1]

So far my working has been:
[![enter image description here][2]][2]


I'm concerned about the step where the ester forms a ring … The methyl group doesn't look like a plausible leaving group but it does not appear in the product so how can I get rid of it?

  [1]: https://i.stack.imgur.com/qB7rY.png
  [2]: https://i.stack.imgur.com/pyrdN.jpg