modify the tree structure