update files to add undo and redo function