finish tree recursion