implemented undo and change