 
         callback(block, textRange, index)
 
-  insertTextAtLocationRange: edit (text, range) ->
-    @blockList = @blockList.editObjectAtIndex range.index, (block) ->
-      block.copyWithText(block.text.insertTextAtPosition(text, range.position))
+  insertTextAtLocationRange: edit (text, locationRange) ->
+    @blockList = @blockList.editObjectAtIndex locationRange.index, (block) ->
+      block.copyWithText(block.text.insertTextAtPosition(text, locationRange.position))
 
   removeTextAtLocationRange: edit (locationRange) ->
     range = @rangeFromLocationRange(locationRange)
     blockList = @blockList.removeObjectsInRange(range)
 
-    leftIndex = locationRange[0].index
+    leftIndex = locationRange.index
     rightIndex = leftIndex + 1
     leftBlock = blockList.getObjectAtIndex(leftIndex)
     rightBlock = blockList.getObjectAtIndex(rightIndex)

        block.copyWithText(text.resizeAttachmentToDimensions(attachment, dimensions))

  rangeFromLocationRange: (locationRange) ->
    leftPosition = @blockList.findPositionAtIndexAndOffset(locationRange[0].index, locationRange[0].position)
    rightPosition = @blockList.findPositionAtIndexAndOffset(locationRange[1].index, locationRange[1].position)
    [leftPosition, rightPosition]

  toJSON: ->


    @blockList = blockList

  replaceTextAtLocationRange: edit (text, locationRange) ->
    @removeTextAtLocationRange(locationRange)
    @insertTextAtLocationRange(text, locationRange)

  addAttributeAtLocationRange: edit (attribute, value, locationRange) ->
    @eachBlockInLocationRange locationRange, (block, range, index) =>
