   checkTimer: =>
     return unless @start?
     return unless @options.timeout?
-    if (elapsed = (Date.now() - @start)) >= @options.timeout
-      throw new Error("Timeout reached: #{elapsed}/#{@options.timeout}ms")
+    returning (elapsed = (Date.now() - @start)), =>
+      if elapsed >= @options.timeout
+        throw new Error("Timeout reached: #{elapsed}/#{@options.timeout}ms")
 
   startTask: =>
     @start ?= Date.now()

  finishTask: =>
    throw new Error("Finished more tasks than started") if @tasks? and @tasks < 1
    @tasks -= 1
    do @checkTimer
    console.log "Finished task, now: #{@tasks}"
    if @tasks == 0
      console.log "All takss finished"
      @start = undefined

  doTask: (code) =>

    sides = front: [], back: []
    @divider ?= polygons[0].clone()
    for poly in polygons
      @doTask =>
        @divider.subdivide poly, @polygons, @polygons, sides.front, sides.back

    for own side, polys of sides
      if polys.length
