implements showTree method