elector('canvas');
    canvas.width = stageWidth;
    canvas.height = stageHeight;
    context = canvas.getContext('2d');

    // Create the particles
    for (var i = 0; i < maxParticles; i++)
        particles.push(new Particle());

    // Start the animation
    prevTime = performance.now();
    animate();
    measurementReady = true;
}

function animate()
{
    var currTime = performance.now();
    var timeDelta = currTime - prevTime;

    context.clearRect(0, 0, stageWidth, stageHeight);

    // Draw e