Adding the data structure to support generating subtrees