implemented showTree