dist function

Distances