completing the tree