added treeBuilder module with a function that computes the next layer of a tree based on the previous layer