added test cases for tree mode