Added undoFrames and commented out resetFrames