                                      in-class-edges)
                     block-y (if (empty? neighbor-ys)
                               0
-                              (if (= compacted :up)
+                              (if (= compaction :up)
                                 (+ (apply max neighbor-ys) node-sep)
                                 (- (apply min neighbor-ys) node-sep)))]
                 (assoc ys block block-y)))
             {}
             class)))
 
-
 (defn get-shift-ys
   "Calculates the relative y-positions of classes. If compacted upward, we walk
   the classes downward; for downward compaction, upward."
-  [classes block-classes class-edges node-sep char-sep rel-ys compacted]
+  [classes block-classes class-edges node-sep char-sep rel-ys compaction]
   (reduce (fn [ys class]
-            (let [rel-op ({:up + :down -} compacted)
+            (let [rel-op ({:up + :down -} compaction)
                   neighbor-ys (map #(rel-op (- (+ (get ys (get block-classes (:dest %)))
                                                   (get rel-ys (:dest %)))
                                                (get rel-ys (:src %)))

                 [{} #{}]
                 start-blocks)))


(defn block-info->ClassGraph
  "For a particular blockification, compacts these blocks in to a ClassGraph,
  in either an :up or :down direction"
  [block-info compacted]
  (let [block-keys (if (= compacted :up)
                     [:blocks-up :simple-succs :sources]
                     [:blocks-down :simple-preds :sinks])
        [blocks classify-edges start-blocks] (map block-info block-keys)

                      :sources sources :sinks sinks
                      :block-succs block-succs
                      :block-preds (:preds block-info)
                      :alignment alignment
                      :compaction compaction})))

(defn FlatGraph->UpDownClassGraphs
  "Organizes nodes and edges into blocks into classes and then constructs a
  ClassGraph, where the nodes are classes and the edges are BlockEdges that
  span classes. This means there can be multiple edges per class pair."
  [flat-graph reversed]
  (let [block-info (FlatGraph->block-info flat-graph)
        alignment (if reversed :right :left)]
    [(block-info->ClassGraph block-info alignment :up)
     (block-info->ClassGraph block-info alignment :down)]))

(defn FlatGraph->ClassGraphs
  "Takes a FlatGraph and creates four variations of it by aggregating nodes and
  segments into blocks in forward and reverse directions, and then organizes
  these blocks both upward and downward"
  [flat-graph]
  (mapcat #(FlatGraph->UpDownClassGraphs % (:reversed (meta %)))
          [flat-graph (with-meta (rev flat-graph) {:reversed true})]))

(defn plot-ys
  "Given a FlatGraph, generate four ClassGraphs, which are used to assign
