initial code for the tree