Undo and redo mostly done