Passing all test cases but tree