and printTree function