updated tree generation