       @calcScreenOffsets()
 
       # Correct for window offsets.
-      frame.avg.x -= Eye.innerScreenX
-      frame.avg.y -= Eye.innerScreenY
+      frame.avg.x -= @innerScreenX
+      frame.avg.y -= @innerScreenY
 
       @indicator.move frame.avg.x, frame.avg.y
 
       @handleGaze()
       @handleBlinks(frame)
-
-  calibrate: ->
-    maxPointCount = 16
-    pointCount = 0
-
-    @connection.send 'calibration:start', maxPointCount
-
-    indicator = @indicator
-    transition = 'all 0.5s'
-    transform = 'translate3d(-5px, -5px, 0)'
-
-    @calcScreenOffsets()
-
-    @indicator.hide()
-
-    points = _.shuffle [
-      [0.1, 0.1], [0.4, 0.1], [0.6, 0.1], [0.9, 0.1]
-      [0.1, 0.4], [0.4, 0.4], [0.6, 0.4], [0.9, 0.4]
-      [0.1, 0.6], [0.4, 0.6], [0.6, 0.6], [0.9, 0.6]
-      [0.1, 0.9], [0.4, 0.9], [0.6, 0.9], [0.9, 0.9]
-    ]
-
-    curtain = utilities.makeElement 'div',
-      zIndex: 100000
-      position: 'fixed'
-      height: '100%'
-      width: '100%'
-      left: 0
-      top: 0
-      backgroundColor: 'transparent'
-      transition:       transition
-      MozTransition:    transition
-      WebkitTransition: transition
-      msTransition:     transition
-
-    point = utilities.makeElement 'div',
-      zIndex: 100001
-      position: 'fixed'
-      height: '10px'
-      width: '10px'
-      borderRadius: '999px'
-      backgroundColor: 'white'
-      left: 0
-      top: 0
-      transform:        transform
-      MozTransform:     transform
-      WebkitTransform:  transform
-      msTransform:      transform
-
-    document.body.appendChild curtain
-    document.body.appendChild point
-
-    setTimeout ->
-      curtain.style.backgroundColor = 'rgba(0,0,0,0.8)'
-    , 100
-
-    nextPoint = ->
-      x = parseInt((window.innerWidth) * points[pointCount][0])
-      y = parseInt((window.innerHeight) * points[pointCount][1])
-
-      point.style.left = x + 'px'
-      point.style.top = y + 'px'
-      Eye.connection.send 'calibration:pointstart',
-        x: x + Eye.innerScreenX
-        y: y + Eye.innerScreenY
-
-      setTimeout ->
-        Eye.connection.send 'calibration:pointend'
-        pointCount++
-        if pointCount < maxPointCount
-          nextPoint()
-        else
-          curtain.style.backgroundColor = 'transparent'
-          setTimeout ->
-            indicator.show()
-            document.body.removeChild curtain
-            document.body.removeChild point
-          , 500
-      , 2000
-
-    nextPoint()

    @enabled = true

  disable: ->
    @triggerEvent 'gazeleave'
    @gazeEls = []
    @indicator.hide()
    @enabled = false

  calcScreenOffsets: ->
    # compute width of borders
    borderWidth = (window.outerWidth - window.innerWidth) / 2

    @connection.connect()


  triggerEvents: (event) ->
    event = event.split /\s+/
    if event.length == 1
      event = event[0]
