implemented tree builder and display result

displays each level of the tree as a list below the previous level