Added a print method for visualizing trees