Corrected distance between function and added function to get terminals from phylogeny
removed unnecessary else from function