added Neighbor Joining tree mechanism