get rid of tree node class, just make the tree a function