Completed the Undo method.