       
     false
 
-  physicsSimulation: ->
+  PhysicsSimulation: ->
     filter_out = fetch 'filtered'
     proposal = fetch @props.proposal
 

              y2 < ny1

  write_positions = -> 
    positions = {}
    for o, i in nodes
      positions[parseInt(opinions[i].user.substring(6))] = \
        [Math.round((o.x - o.radius) * 10) / 10, Math.round((o.y - o.radius) * 10) / 10]

    opts.done?(positions)

  ##############
  # Initialize positions of each node
  targets = {}
  opinions = opts.o.slice()
  width = opts.w or 400
  height = opts.h or 70
  r = calculateAvatarRadius width, height, opinions

  nodes = opinions.map (o, i) ->
    x_target = (o.stance + 1) / 2 * width

    if targets[x_target]
      if x_target > .98
        x_target -= .1 * Math.random() 
      else if x_target < .02
        x_target += .1 * Math.random() 

    targets[x_target] = 1

    x = x_target
    y = height - r

    return {
      index: i
      radius: r
      x: x
      y: y
      x_target: x_target
    }

  ###########
  # run the simulation
  stable = false
  alpha = .8
  decay = .8
  min_alpha = 0.0000001
  x_force_mult = 2
  y_force_mult = 2

  total_ticks = 0
  collisions = 0 

  loc = fetch 'location'
  if loc.query_params.show_histogram_physics
    iterate = => 
      stable = tick alpha
      alpha *= decay
      total_ticks += 1

      console.log "Tick: #{total_ticks} Collisions: #{collisions}"
      collisions = 0

      stable ||= alpha <= min_alpha

      if !aborted
        write_positions()

      aborted = opts.abort?()
      if stable || aborted
        histo_run_next_job(opts)
      else 
        setTimeout iterate, loc.query_params.show_histogram_physics or 100
    iterate()

  else 
    while true
      stable = tick alpha
      alpha *= decay


      DIV 
        style: 
          paddingTop: histo_height - @props.height

        HistoAvatars
          dirtied: dirtied
