Tandem michael reactions for the construction of pyrrolidine and piperidine ring systems