improvements to undo