more progress on undo and redo