added test to print tree