add special cases for trees that have no branches