Undo Command and Macro Command implementation