restructure tree printing