TreeGenerator improved on