Completed undo redo implementation