update the tree function