Added undo method.