     else
       throw new Error "Invalid argument #{side}, expected 'left' or 'right'"
     index = 0
-    for index in [0..array.length-1]
-      if array[index].equals selection
+    for sel, index in array
+      if sel.equals selection
         array.splice index, 1
         break
 

      # delete all the selections within
      indexStart = absoluteFromRelative start, 0, @
      length = (@getWords 0).length
      while end >= length
        end -= 1
      endPos = (@getWord end).word.length-1
      indexEnd = absoluteFromRelative end, endPos, @
      opts = {bind: false}
      selection = new Selection indexStart, indexEnd, @, opts

      for sel in @getSelections((s) -> s.in(selection))
        sel.unbind()
        @removeSel sel

  # Merge two words at position
  #

  #   Delete the word at position
  #
  #   @param [Integer] position position the word to delete
  #
  # @note selections that where bound to any of the deleted word
  # are moved to the beginning of the first word not deleted
  deleteWords: (start, end) ->
    if _.isUndefined(end)
      end = start+1
