Added a method to output the entire tree.