re-structuring the tree