 
     return null
 
+  findNextJumpNode: (target) ->
+    parent = $(target).parent()
+
+    nextSibling = $(parent).next()
+
+    if nextSibling == undefined
+      return this.findNextJumpNode parent
+
+    else if nextSibling.length == 0
+
+      tagName = $(nextSibling).prop("tagName")
+
+      if tagName != undefined
+        tagName = tagName.toLowerCase()
+
+        if tagName == 'body' or tagName == 'html'
+          return nextSibling
+        else
+          return this.findNextJumpNode parent
+      else
+        return this.findNextJumpNode parent
+
+    return nextSibling
 
   moveToNextSentence: (event) ->
     if this.operational == false
       # we are not in sentence selection mode
       return
 
-    this.currentIndex = this.currentIndex + 1
     currentSelection = window.getSelection()
 
-    this.selectSentence(currentSelection.anchorNode.parentElement)
+    this.currentIndex = currentSelection.extentOffset
+    this.currentSentence = this.currentSentence + 1
+
+    elementToUse = currentSelection.extentNode.parentElement
+
+    if elementToUse.textContent.length <= (this.currentIndex)
+      nextSibling = $(elementToUse).next()
+
+      this.currentIndex = 0
+      this.currentSentence = 0
+
+      # algorithm here is:
+      # 1. check if there is a sibling
+      # 2. if there is no sibling, check the parent
+      # 3. if the parent has a sibling, use that
+      # 4. if the parent has no sibling, pass parent as element to 2
+
+      if nextSibling == undefined or nextSibling.length == 0
+        nextSibling = this.findNextJumpNode(elementToUse)
+
+      elementToUse = nextSibling
+
+    this.selectSentence elementToUse
 
     selection = Annotator.Util.getGlobal().getSelection()
     ranges = for i in [0...selection.rangeCount]

    this.storedEvent = event

    this.currentIndex = 0
    this.selectSentence event.target

    selection = Annotator.Util.getGlobal().getSelection()

  pluginInit: ->
    # Register the event handlers required for creating a selection
    $(document).bind({
      "click": @findASentence
    })

    this.operational = false
    this.currentIndex = 0
    this.currentSentence = 0
    this.storedEvent = null
    this.extentElement = null

    null

  destroy: ->
    $(document).unbind({
      "click": @findASentence
    })
    super

  toggleOperation: () ->
    this.operational = not this.operational

  anchorToPage: (data) ->
    anchor = new xpathRange.SerializedRange(data).normalize(document)

    window.getSelection().removeAllRanges()
    window.getSelection().addRange(anchor.toRange())

    return null

  normalizeStyleTags: (target) ->

    return target

    # Get the currently selected ranges.
    tagName = $(target).prop("tagName").toLowerCase()

    # this loop checks that we are not within a formatting cell and that we should recurse upwards through parent elements
