Undo and Save functions fully working