     p.y += window.scrollY  if window.scrollY
     p
 
-  draw: ->
+  draw: (dom)->
     console.log "start of draw() function"
     ctx = @ctxFromLoadXMLDoc
     e = @eFromLoadXMLDoc

      ctx.clearRect 0, 0, cWidth, cHeight
      console.log "clearing: " + cWidth + " " + cHeight
    e.render ctx
    #if @isFirstRender
    #  @isFirstRender = false




    waitingForImages = true
    if @ImagesLoaded()
      waitingForImages = false
      @draw(dom)

    console.log ">>>>>> starting interval with fps: " + @FRAMERATE
    @intervalID = setInterval(=>
