 updatePopulation = ->
   E('population').innerHTML = ""+cells.count
     
-#redraw()
-updatePopulation()
-redrawLoop()
 
 class MouseToolCombo extends MouseTool
   constructor: (@x0, @y0) ->

    
    T = M.mul(M.mul(@endOffset, Mdelta), M.hyperbolicInv(@startOffset))

    #dT = M.powerPade T, 1.0/(stepsPerGen * generations)
    #console.log "Offset matrix determined: #{JSON.stringify T}"

    steps = generations * stepsPerGen
    timerId = setInterval (=>
      observer.navigateTo @startChain, @startOffset
      p = 1.0-steps/(stepsPerGen * generations)
      dT = M.powerPade T, p
      observer.modifyView dT
      drawEverything()
      steps -=1
      #console.log "offset! remaining steps: #{steps}"
      #console.log "cur tfm: #{JSON.stringify observer.getViewOffsetMatrix()}"
      if steps < 0
        clearInterval timerId

  if (handler = shortcuts[keyCode])?
    e.preventDefault()
    handler(e)
    
##Application startup    
updatePopulation()
updateCanvasSize()
updateGrid()
updateMemoryButtons()
updatePlayButtons()
redrawLoop()
#redraw()
