added cleanup and gensym