         phase = @ruleset_phase
         iruleset = @inverse_ruleset
         for i in [0...step_size]
-          phase = mod (phase-1), iruleset.length
-          @gol.untransform iruleset[phase]
+          phase = mod (phase-1), iruleset.size()
+          @gol.untransform iruleset.rules[phase]
           
         @ruleset_phase = phase
         @generation -= @step_size

            c = parseInt sz[0], 10
            r = parseInt sz[1], 10
            throw new Error "Width and height must be even"  if r % 2 isnt 0 or c % 2 isnt 0
            @gol = new MargolusNeighborehoodField(new Array2d(c, r), @rule)
            @gol.clear()
            @view = new FieldView(@gol.field)
            #console.log "Updated field width to #{keys.size}"

          
      set_rule: (rule) ->
        @rule = rule
        @rule_phase = 0
        @inverse_rule =
          try
            rule.reverse()
