     window.requestAnimationFrame(@draw)
 
 MOUSE =
-  pos: undefined
+  pos: 
+    x: 0
+    y: 0
   mass: 1000
 $ ->
   MOUSE = 

    @canvas = @$canvas[0]
    @$canvas.mousemove(@update_mouse_pos)
    @particles = @generate_particles(50)
    @tick = 1

  generate_particles: (num) ->
    colors = ['green', 'blue', 'green', 'purple', 'maroon', 'orange']
    funcs = _.times(num, () =>
      -> return new Particle(_.random(0, @canvas.width),
                             _.random(0, @canvas.height),
                             0.1,
                             colors[_.random(0, 6)])
    )
    return _.map(funcs, (f) -> f())


    start = Date.now()
    ctx = @canvas.getContext("2d")
    ctx.globalCompositeOperation = 'source-over'
    ctx.fillStyle = "rgba(0, 0, 0, #{255 * 2 * @tick})"
    ctx.fillRect(0, 0, @canvas.width, @canvas.height)
    #ctx.clearRect(0, 0, @canvas.width, @canvas.height)

    for particle in @particles
      particle.update(@canvas, ctx, @tick)
