eliminated Branch constructor, added flattenTree