started command pattern for undo/redo and refactored the moveLeft/moveRight code