completed print_tree() test function