^ generateTree
finalized the random tree generation function.