starting the tree function