Added Pattern Command for undo/redo