Added a undo/redo feature