       mark.dragging = false
       mark.moving = false
 
+  onMouseUp: (e) =>
+    @onTouchEnd(e)
+
+    if @containsPoints(@canvasGraph.data.x)
+      # console.log @canvasGraph.data.x
+      console.log 'CONTAINS POINTS!' 
+    else
+      console.log 'NO POINTS IN HERE!'
+      marks.remove(@)
+      classifier.notify 'There are no points in the mark.'
+      @canvasGraph.shakeGraph()
+    
     $(document).trigger("mark-change")
 
+  containsPoints: (xValues) =>
+    console.log 'containsPoints()'
+    # console.log 'xValues: ', xValues
+    
+    # console.log 'this (mark): ', @, '[',@dataXMinRel,',',@dataXMaxRel,']'
+    # # console.log 'data: ', data
+    for value in xValues
+      # console.log 'POINT: ', value
+      if value <= @dataXMaxRel and value >= @dataXMinRel
+        return true
+    return false
+
   toCanvasXPoint: (e) -> e.pageX - @canvas.getBoundingClientRect().left - window.scrollX
 
 module?.exports = CanvasGraph: CanvasGraph, Marks: Marks, Mark: Mark


class Marks
  constructor: -> @all = []
  create: (mark) -> document.getElementById('marks-container').appendChild(mark.element)
  add: (mark) -> @all.push(mark)

  remove: (mark) ->

  showFakePrevMarks: () ->
    # console.log 'showFakePrevMarks()'
    @zoomOut( =>
      maxMarks = 5
      minMarks = 1 
      howMany = Math.floor( Math.random() * (maxMarks-minMarks) + minMarks )
      # console.log 'randomly generating ', howMany, ' (fake) marks' # DEBUG
      @generateFakePrevMarks( howMany )
