Added Command design pattern to allow Undo