   (:refer-clojure :exclude  [compare])
   (:require [lseq-tree.base :refer [base bit sum]]
             [lseq-tree.lseq-node :refer [node]]
-            [lseq-tree.triple :refer [triple]]))
-
-;; TODO abstract the math away so it is js and java compliant
-
-(defn pow [n x]
-  (Math/pow n x))
+            [lseq-tree.triple :refer [triple]]
+            [lseq-tree.util :refer [pow]]))
 
 (defrecord ID [digit site counter])
 

           (recur (first children)
                  digit (conj id-site site) (conj id-counter counter)
                  (inc level)))
         (id id-digit id-site id-counter))))))

(defn digit->path
  [digit base level bit-length]

     (recur (first (:children node)) (inc acc)))))

(defn node->id
  [node base]
   (let [length (depth node)]
     (loop [{:keys [children]
             {:keys [path site counter]} :triple} node
