 (defn jgtype
   [jg stroke-or-node]
   (get-in jg [:types stroke-or-node]))
+
+(defn bottom?
+  [stroke-or-node]
+  (let [snstr (if (keyword? stroke-or-node) (name stroke-or-node) (str stroke-or-node))
+        prefix (subs snstr 0 (min 2 (count snstr)))]
+    (or (= "sb" prefix)
+        (= "nb" prefix))))
 
 (defn believed
   "Returns black nodes."

                                (update-in [:graph] graph/add-edges [:sbottom :nbottom]))]
    (reduce (fn [jg2 node-set]
              (let [nodes-str (str/join "-" (map (fn [n] (if (keyword? n) (name n) (str n))) node-set))
                    bottom-set-stroke (format ":sb-%s" nodes-str)
                    bottom-set-node (format ":nb-%s" nodes-str)]
                (reduce (fn [jg3 node]
                          (-> jg3
                              (assoc-in [:types node] :node)

    jg
    ;; something to do (inconsistent), spread black
    ;; first case: a stroke is white but has all black incoming nodes; or, it points to a black node; turn it black
    (if-let [bad-stroke (first (filter (fn [s] (and (not (bottom? s))
                                                    (= :white (jgcolor jg s))
                                                    (or (and (not-empty (graph/incoming (:graph jg) s))
                                                             (every? (fn [n] (= :black (jgcolor jg n)))
