change tree printing code