Mechanism for the intra-molecular exchange of an ester and a nitrile group When the isolated product 4 is treated with sodium ethoxide in ethanol it rearranges to 5 as shown:


My TA says that you need to start with a reverse Claisen at the ketone but I am not quite sure where to go from there. I do not know how to move the nitrile alpha to the carbonyl furthest from the methyl group.
Following is a reasonable suggestion for the rearrangement: