Refactored undo functionality to actually be called undo and added codo