Added Pattern Command for Undo/Redo