     @redoStack = []
     undoDelta = oldDelta.invert(changeDelta)
     timestamp = new Date().getTime()
-    if @lastRecorded + @options.delay > timestamp and @undoStack.length > 0
-      change = @undoStack.pop()
+    if @lastRecorded + @options.delay > timestamp and @stack.undo.length > 0
+      change = @stack.undo.pop()
       undoDelta = undoDelta.compose(change.undo)
       changeDelta = change.redo.compose(changeDelta)
     else
       @lastRecorded = timestamp
-    @undoStack.push({
+    @stack.undo.push({
       redo: changeDelta
       undo: undoDelta
     })
-    @undoStack.unshift() if @undoStack.length > @options.maxStack
+    @stack.undo.unshift() if @stack.undo.length > @options.maxStack
 
   redo: ->
-    if @redoStack.length > 0
-      change = @redoStack.pop()
-      _ignoreChanges.call(this, =>
-        @editor.applyDelta(change.redo, { source: 'user' })
-        index = getLastChangeIndex(change.redo)
-        @editor.setSelection(new Scribe.Range(@editor, index, index))
-      )
-      @undoStack.push(change)
+    _change.call(this, 'redo', 'undo')
 
   transformExternal: (delta) ->
     return if delta.isIdentity()
-    @undoStack = _.map(@undoStack, (change) ->
+    @stack['undo'] = _.map(@stack['undo'], (change) ->
       return {
         redo: delta.follows(change.redo, true)
         undo: change.undo.follows(delta, true)

  if delta.endLength < delta.startLength + offset
    lastChangeIndex = delta.endLength
  return lastChangeIndex

_ignoreChanges = (fn) ->
  oldIgnoringChanges = @ignoringChanges

    )

  undo: ->
    _change.call(this, 'undo', 'redo')


module.exports = Scribe
