random tree generation