Detecting leafs within trees.