             (empty? q)
             src2img
 
+            (nil? b)
+            nil
+            
             (= b (src2img a))
             (recur src2img (pop q))
             

  (when (.isUnimodularIntegerMatrix M)
    (let [sigs (node-signatures net)
          d (.minus (first (first (sigs w))) (first (first (sigs v))))
          op (.times (Operator. (extend-matrix M)) (Operator. d))
          check-sigs (fn [a b] (equal-sigs? (map-sig op (sigs v)) (sigs w)))]
      (loop [src2img {}
             q (conj empty-queue [v w])]
        (let [[a b] (first q)]

                     (into (pop q)
                           (for [d (keys nv)
                                 :let [e1 (.get nv d)
                                       e2 (.get nw (.times d op))]]
                             [e1 e2]))))))))))

(defn symmetries [net]
