building the tree.