the tree construction and other problems rectified but the nodes are merging while displaying