got build_tree working on browser