creates new groups when selecting branches of the tree