more accurate tree generation