Adapted example for tree generation.