 
 
   _onTouchEnd: (e, cube) ->
-    @_touchStarted = false
+    cube.touchStarted = false
     mod = cube.yDelta % 90
     if mod < 45
       cube.yLast = cube.yDelta + mod



  _onTouchMove: (e, cube) ->
    return unless @_touchStarted
    e.preventDefault()
    cube.diff = (e.pageY - cube.y1) * @touchSensitivity
    cube.yDelta = cube.yLast - cube.diff

      cube.el.appendChild cube[side]

    eventPairs = [['TouchStart', 'MouseDown'], ['TouchMove', 'MouseMove'],
      ['TouchEnd', 'MouseUp'], ['TouchLeave', 'MouseLeave']]
    mouseLeaveSupport = 'onmouseleave' of window

    for eventPair in eventPairs
      for eString in eventPair then do (fn = '_on' + eventPair[0], cube) =>
        unless (eString is 'TouchLeave' or eString is 'MouseLeave') and !mouseLeaveSupport
          cube.el.addEventListener eString.toLowerCase(), ((e) => @[fn] e, cube), true
        else
          cube.el.addEventListener 'mouseout', ((e) => @_onMouseOut e, cube), true

    @_setSides cube
    cube
