   ITransientMap
   (-dissoc! [tcoll key] (.without! tcoll key)))
 
-(deftype NodeSeq [meta nodes dlen nloc i s ^:mutable __hash]
+(deftype NodeSeq [meta arr lvl nodes cursors-lengths data-idx data-len ^:mutable __hash]
   Object
   (toString [coll]
     (pr-str* coll))

             (if (< i 100)
               (recur (assoc m (nth test-keys i) i) (inc i))
               m)))
  (let [thm (loop [m lem i 0]
              (if (< i 10000)
                (recur (assoc m (nth test-keys i) i) (inc i))
                m))
        root (.-root thm)
        nodes (make-array 7)
        cursors-lengths (make-array 14)]
    (aset nodes 0 root)
    (aset cursors-lengths 0 0)
    (aset cursors-lengths 1 (.node-arity root))
    (let [args [(.get-array root) 0 nodes cursors-lengths 0 (.data-arity root)]
          args (if ^boolean (.has-data? root) args (apply node-next-seq args))]
      (loop [i 1 args args]
        (if-let [nargs (apply node-next-seq args)]
          (recur (inc i) nargs)
          i))))
  (let [times 1000
        hm1 (loop [m lem i 0]
               (if (< i times)

  (-reduce [coll f] (seq-reduce f coll))
  (-reduce [coll f start] (seq-reduce f start coll)))

(defn- create-inode-seq [arr lvl nodes cursors-lengths data-idx data-len]
  (if (< (inc data-idx) data-len)
    (NodeSeq. nil arr lvl nodes cursors-lengths (inc data-idx) data-len nil)
    (let [nodes     (aclone nodes)
          cursors-lengths (aclone cursors-lengths)]
      (loop [lvl lvl]
        (when (>= lvl 0)
          (let [node-idx (aget cursors-lengths (* lvl 2))
                node-len (aget cursors-lengths (inc (* lvl 2)))]
            (if (< node-idx node-len)
              (let [node (.get-node (aget nodes lvl) node-idx)
                    has-nodes ^boolean (.has-nodes? node)
                    new-lvl (if has-nodes (inc lvl) lvl)]
                (aset cursors-lengths (* lvl 2) (inc node-idx))
                (when has-nodes
                  (aset nodes new-lvl node)
                  (aset cursors-lengths (* new-lvl 2) 0)
                  (aset cursors-lengths (inc (* new-lvl 2)) (.node-arity node)))
                (if ^boolean (.has-data? node)
                  (NodeSeq. nil (.get-array node) new-lvl nodes cursors-lengths 0 (.data-arity node) nil)
                  (recur (inc lvl))))
              (recur (dec lvl)))))))))

(extend-protocol IPrintWithWriter
  NodeSeq
