Make the tree printing function clearer