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

  Reversible
  (rev [this]
    (assoc this
      :succs preds
      :preds succs
      :ps qs
      :qs ps
      :layers (vec (rseq layers)))))

(defrecord SparseLayer [id duration nodes])
(defrecord OrderedGraph [layers succs preds ps qs minus-ps minus-qs characters]
  Reversible
  (rev [this]
    (assoc this
      :succs preds
      :preds succs
      :ps qs
      :qs ps
      :minus-ps minus-qs
      :minus-qs minus-ps
      :layers (vec (rseq layers)))))

(defrecord OrderedLayer [id duration items])
(defrecord CountedAndMarkedGraph [layers succs preds crossings marked characters]) ; still has OrderedLayers

  Reversible
  (rev [this]
    (assoc this
           :succs preds
           :preds succs
           :layers (vec (rseq layers))))
  Flippable
  (flip [this]
    (assoc this
           :aboves belows
           :belows aboves
           :top-idxs bot-idxs
           :bot-idxs top-idxs)))

(defrecord FlatLayer [id duration items])
(defrecord BlockGraph [blocks succs preds sources])
