    (let [tree (tree 3 +)]
      (dotimes [i 10]
        (.assoc! tree i (* 2 i)))
+     (aggregate (.-root tree))
+     ))
+
+   (let [tree (tree 3 +)]
+     (dotimes [i 100]
+       (.assoc! tree i (* 2 i)))
      ;(collect tree 3 7)
      ;(.seek (iterator tree) 4)
      (.log js/console tree)
-     (aggregate-range tree 2 5)
-     ))
-
-  4 + 6 + 8 +10
+     (console-time "foo"
+      (aggregate-range tree 5 15))
+     )
 
   )

(defn aggregate-range [tree from to]
  (let [results (array)]
    (down-until-contained (.-root tree) nil nil from to results)
    (println results)
    (let [len (.-length results)
          func (.-aggregateFunc tree)]
      (loop [i 0

(ns aurora.scantree
  (:require-macros [aurora.macros :refer [apush console-time]]))

;; NOTE iterators are not write-safe

