     (conj (.visited? p) dst)
     (+ (.cost p) (.cost c))))
 
-(def graph-conversion-path
-  (fn [g src dst]
-    (let [path (ConversionPath. (vector) (vector) #{src} 0)]
-      (if (assignable? src dst)
-        path
-        (let [q #?(:bb (atom ())
-                   :default (PriorityQueue.))
-              add #?(:bb #(swap! q (fn [prev]
-                                     (sort-by (fn [^ConversionPath p]
-                                                [(.cost p) (count (.path p))])
-                                              (fn [a b] (compare b a))
-                                              (conj prev %))))
-                     :default #(.add q %))
-              poll #?(:bb #(-> (swap-vals! q next) first first)
-                      :default #(.poll q))
-              _ (add path)
-              dsts (equivalent-targets g dst)]
-          (loop []
-            (when-some [^ConversionPath p (poll)]
-              (let [curr (or (-> p .path last second) src)]
-                (if (some #(assignable? curr %) dsts)
-                  p
-                  (do (run! (fn [[[src dst] c]]
-                              (when (and (> max-path-length (count (.path p)))
-                                         (not ((.visited? p) dst)))
-                                (add (conj-path p src dst c))))
-                            (possible-conversions g curr))
-                      (recur)))))))))))
+(defn graph-conversion-path [g src dst]
+  (let [path (ConversionPath. [] [] #{src} 0)]
+    (if (assignable? src dst)
+      path
+      (let [q #?(:bb (atom ())
+                 :default (PriorityQueue.))
+            add #?(:bb #(swap! q (fn [prev]
+                                   (sort-by (fn [^ConversionPath p]
+                                              [(.cost p) (count (.path p))])
+                                            (fn [a b] (compare b a))
+                                            (conj prev %))))
+                   :default #(.add q %))
+            poll #?(:bb #(-> (swap-vals! q next) ffirst)
+                    :default #(.poll q))
+            _ (add path)
+            dsts (equivalent-targets g dst)]
+        (loop []
+          (when-some [^ConversionPath p (poll)]
+            (let [curr (or (-> p .path last second) src)]
+              (if (some #(assignable? curr %) dsts)
+                p
+                (do (run! (fn [[[src dst] c]]
+                            (when (and (> max-path-length (count (.path p)))
+                                       (not ((.visited? p) dst)))
+                              (add (conj-path p src dst c))))
+                          (possible-conversions g curr))
+                    (recur))))))))))
 
 (defn- replace-range [v replacement idxs]
   (concat (subvec v 0 (first idxs))

(defn- collect-targets [v]
  (reduce
    (fn [r [k v]]
      (if (map? v)
        (concat r (collect-targets v))
        (concat r v)))
    (vector) v))

(defn- add-conversion [m ^Types src dst conversion]
  (let [add #(update % (peek (.types src))

  (possible-conversions [_ src]))

(defn- expand [[a b]]
  (when-some [[bf & br] (seq b)] 
    (cons
      [(conj a bf) br]
      (expand [a br]))))

(defn- combinations [n s]
  (letfn [(combos [n s]
            (if (zero? n)
              (list [[] s])
              (mapcat expand (combos (dec n) s))))]
    (map first (combos n s))))

