                  action (gen key-len)]
                 (run-lookup-prop min-keys key-len actions action)))
 
-(defn gen-next [key-len]
-  (gen/make-gen
-   (fn [rnd size]
-     [[:next] nil])))
-
 (defn gen-seek [key-len]
   (gen/make-gen
    (fn [rnd size]
      (let [key (make-simple-key rnd size key-len)]
        [[:seek key] nil]))))
 
-(defn gen-movement [key-len]
-  (gen/make-gen
-   (fn [rnd size]
-     (let [key (make-simple-key rnd size key-len)]
-       (if (pprng/boolean rnd)
-         [[:next] nil]
-         [[:seek key] nil])))))
-
 (defn apply-to-iterator [iterator movements]
   (for [movement movements]
     (case (nth movement 0)
-      :next (do
-              (.next iterator)
-              (.key iterator))
-      :seek (do
-              (.seek iterator (nth movement 1))
-              (.key iterator)))))
+      :next (.next iterator)
+      :seek (.seek iterator (nth movement 1)))))
 
 (defn apply-to-elems [elems movements]
   (let [cur-elems (atom elems)]

(defn product-join-prop [key-len]
  (prop/for-all [min-keys gen/s-pos-int
                 actions (gen/vector (gen-action key-len))
                 movements (gen/vector (gen-movement key-len))]
                (run-product-join-prop min-keys key-len actions movements)))

(comment

;; On seek, point to first key greater than or equal to seek-key, or otherwise the last key
;; NOTE iterators are not write-safe unless reset after writing

(deftype Iterator [tree ^:mutable node ^:mutable ix]
  Object
  (reset [this]
         (set! node (.-root tree))
         (while (not (nil? (.-children node)))
           (set! node (aget (.-children node) 0)))
         (set! ix 0)
         (set! end? (<= (alength (.-keys node)) 0)))
  (seek [this key]
        (let [start-node node
              start-ix ix]
