cleaning up the tree