Added tree recursion stuff