Implemented undo/redo logging