   (new DSymbol "1.1:16 1:2 4 6 8 10 12 14 16,16 3 5 7 9 11 13 15:8"))
 
 (def boundary-mappings
-  (let [offset (fn [p] (mod (- 19 p) 16))
-        box (fn [i] (Integer. i))
-        template-boundary (boundary-chambers template (box 1) 0 1 2)
-        octagon-boundary (cycle (map box (range 1 17)))
-        mapping (fn [p] (zipmap (drop (offset p) octagon-boundary)
-                                (take 16 template-boundary)))]
+  (let [template-boundary (boundary-chambers template (Integer. 1) 0 1 2)
+        octagon-boundary (cycle (map #(Integer. %1) (range 1 17)))
+        mapping #(zipmap (drop (mod (- 19 %1) 16) octagon-boundary)
+                         (take 16 template-boundary))]
     (map mapping (range 1 16 2))))
 
 (defn apply-to-template [ds oct2tmp]

  (:gen-class))

(defn iterate-cycle [coll x]
  (reductions (fn [x f] (f x)) x (cycle coll)))

(defn lazy-mapcat [f & colls]
  (lazy-seq

             (apply lazy-mapcat f (map rest colls))))))

(defn walk [ds D & idxs]
  (reduce #(.op ds %2 %1) D idxs))

(defn chain-end [ds D i j]
  (letfn [(step [E]
