tree generator homework