                      (do
                        (aset seek-key new-var max-key)
                        (recur new-var (+ new-var 1) 0))
-                     (recur new-var new-var (mod (+ current 1) num-iterators)))))))
+                     (recur new-var new-var (mod (+ current 1) num-var-iterators)))))))
 
            (< new-var old-var)
            ;; UP: assumes prefixes and keys all equal, nothing at end
            (if (== old-var 0)
              (set! end? true)
              (let [new-var (- old-var 1)
-                   iterators (aget var->iterators new-var)
-                   iterator (aget iterators (- (alength iterators) 1))]
+                   var-iterators (aget var->iterators new-var)
+                   iterator (aget var-iterators (- (alength var-iterators) 1))]
                (debug :up old-var seek-key)
                (when (< old-var (alength var->iterators))
                  (aset seek-key old-var least))


           (== old-var new-var)
           ;; ACROSS: assumes prefixes all equal, keys not all equal, iterators sorted by ascending key, nothing at end
           (let [iterators (aget var->iterators new-var)
                 num-iterators (alength iterators)
                 previous (mod (- current 1) num-iterators)
                 max-key (.key-at (aget iterators previous) new-var)
                 iterator (aget iterators current)
                 min-key (.key-at iterator new-var)
                 old-key (.inner-key iterator)]
             (debug :search max-key current seek-key)

                                  (when (true? (aget iterator->var->present? i j))
                                    (apush var-iterators (aget join-iterators i))))
                                var-iterators))
        var->iterator->reset? (amake [j num-vars]
                                     (amake [i (alength iterators)]
                                            (and (> j 0)
                                                 (true? (aget iterator->var->present? i j))
                                                 (false? (aget iterator->var->present? i (- j 1))))))
        join (Join. seek-key join-iterators var->iterators var->iterator->reset? false)]
    (.reset join)
    join))

