Creating an undo/redo system