   transforms an OrderedLayer into a FlatLayer composed of Nodes and Segments"
   [ordered-layer]
   (map->FlatLayer (assoc ordered-layer
-                    :items (map #(if (instance? Edge %)
-                                   (Edge->Segment % (:id ordered-layer))
-                                   %)
-                                (-> ordered-layer :items flatten)))))
+                         :items (map #(if (instance? Edge %)
+                                        (Edge->Segment % (:id ordered-layer))
+                                        %)
+                                     (-> ordered-layer :items flatten)))))
 
 
 (defn CountedAndMarkedGraph->FlatGraph

                                     minus-ps minus-qs)
                                (apply map vector))]
    (map->CountedAndMarkedGraph (assoc ordered-graph
                                  :crossings (reduce + crossings)
                                  :marked (reduce set/union marked)))))


(defn best-ordering

              last-node (-> new-g :last-nodes-by-character character)
              disappeared (contains? (-> node :path-mods character) :disappeared)
              g (cond-> new-g
                  disappeared (update-in [:last-nodes-by-character] dissoc character)
                  (not disappeared) (->
                                     (assoc-in [:last-nodes-by-character character] node)
                                     (update-in [:last-nodes-by-node (:id node)] (fnil conj #{}) character))
                  last-node (update-in [:last-nodes-by-node (:id last-node)] disj character))]
          (recur g (rest characters)))))))


