Cleaning up the tree