clean up tree script
more cleanup of tree script