 
 class Sheet
     
-    constructor: (@spec) ->
-        @spec.data ?= [[0]]
-        @spec.colHeaders ?= ("c#{k}" for k in [0...@spec.data[0].length])
-        @spec.rowHeaders ?= ("r#{k}" for k in [0...@spec.data.length])
+    constructor: (spec) ->
+        spec.data ?= [[0]]
+        @id = spec.id
+        @data = spec.data
+        @colHeaders ?= ("c#{k}" for k in [0...spec.data[0].length])
+        @rowHeaders ?= ("r#{k}" for k in [0...spec.data.length])
 
     rowJson: ->
         x = {}
-        x[rh] = @spec.data[k] for rh, k in @spec.rowHeaders
+        x[rh] = @data[k] for rh, k in @rowHeaders
         return x
 
     labelRows: ->
-        ([@spec.rowHeaders[m]].concat row for row, m in @spec.data)
+        ([@rowHeaders[m]].concat row for row, m in @data)
 
     toLocal: ->
-        #console.log "app.sheet", app.sheet
-        eval("#{@spec.id} = app.sheet['#{@spec.id}'].spec.data")
+        eval("#{@id} = app.sheet['#{@id}'].data")
 
     fromLocal: (u)->
-        app.sheet[@spec.id].spec.data = u
-
+        app.sheet[@id].data = u
 
 $blab.compute = ()->
 


        @sheet = {}
        specs = JSON.parse(@file["sheet.json"])
        @sheet[spec.id] = new Sheet spec for spec in specs 

        # components


        make = (type) =>
            @component[type] = {}
            for spec in JSON.parse(@file["#{type}.json"])
                spec.containerId ?= "app"
                @component[type][spec.id] = new @toolbox[type](spec, @sheet, @file)
        make(type) for type of @toolbox

