     
     for [suffix, rewrite] in ruleset.items()
         gSuffix = groupPowersVd(suffix)
-        gSuffix.reverse()
+        #gSuffix.reverse()
         gRewrite = groupPowersVd(rewrite)
-        gRewrite.reverse()
+        #gRewrite.reverse()
         if ignorePowers
             if gSuffix.length is 1 and gRewrite.length is 1 and gSuffix[0][0] is gRewrite[0][0]
                 continue

        @block =>
            @line("//Non-trivial rewrites, when new element is #{newElement}")
            nodeConstructor=@_nodeClass(newElement)
            @line("chain = new #{nodeConstructor}(power, chain);")
            @generateRewriteBySuffixTree(newElement, @suffixTree, 'chain')
            
    generateRewriteBySuffixTree: ( newElement, suffixTree, chain)->

  g = new CodeGenerator(s)
  g.debug=false
  
  rewriterCode = g.generateAppendRewriteOnce()
  console.log rewriterCode
  appendRewriteOnce = eval rewriterCode
  throw new Error("Rewriter failed to compile") unless appendRewriteOnce?
  
  appendRewrite = repeatRewrite appendRewriteOnce    
