         [("1001"), ("0110")],
         [("0111"), ("1011"), ("1110"), ("1101")]]
 
-      for row in elements
-        dom.tag("div").CLASS("func_row")
-        isFirst = true
-        for x_str,j in row
-          x_value = parseInt(x_str, 2)
-          y_value = rule[x_value]
-          unless y_value is x_value
-            dom.tag("span").CLASS("icon icon-separator").end()  unless isFirst
-            dom.tag("span").CLASS("func_pair")
-               .tag("span").CLASS(cells_icon(x_value)).end()
-               .tag("span").CLASS("icon icon-rarrow").end()
-               .tag("span").CLASS(cells_icon(y_value)).end()
-               .end() #func-pair
-            isFirst = false
-        dom.end() #div
+      ruleObj.validate()
+      rule = ruleObj.table
+      for elemRule in ruleObj.rules
+        rule = elemRule.table
+        for row in elements
+          dom.tag("div").CLASS("func_row")
+          isFirst = true
+          for x_str,j in row
+            x_value = parseInt(x_str, 2)
+            y_value = rule[x_value]
+            unless y_value is x_value
+              dom.tag("span").CLASS("icon icon-separator").end()  unless isFirst
+              dom.tag("span").CLASS("func_pair")
+                 .tag("span").CLASS(cells_icon(x_value)).end()
+                 .tag("span").CLASS("icon icon-rarrow").end()
+                 .tag("span").CLASS(cells_icon(y_value)).end()
+                 .end() #func-pair
+              isFirst = false
+          dom.end() #div
+        dom.tag("hr").end()
       element.innerHTML = ""
       element.appendChild dom.finalize()
 


      doStepSimpleRule: (step_size) ->
          for i in [0...step_size]
            @gol.transform @rule
            @onStep 0
          @phase = (@phase+step_size) % @ruleset.length
          @generation += step_size

      doStepRuleset: (step_size) ->
        phase = @ruleset_phase
        ruleset = @ruleset
        for i in [0...step_size]
          @gol.transform ruleset[phase]
          @ruleset_phase = phase = (phase+1) % ruleset.length
          @onStep phase
        @generation += step_size

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