added CodeHistory for undo/redo operations