lse;
  });

  elem.addEventListener('mouseout', function(e) {
  elem.classList.remove("activated");

  for (var i = 0; i < scope.waves.length; i++) {
    // Declare the next wave that has mouse down to be mouse'ed up.
    var wave = scope.waves[i];
    if (wave.isMouseDown) {
      wave.isMouseDown = false
      wave.mouseUpStart = now();
      wave.mouseDownStart = 0;
      wave.tUp = 0.0;
      wave.cancelled = true;
      break;
    }
  }
  return false;
  });

  return scope;
};

// Shortcuts.
var pow =