adding new algorithm to draw the tree.