The choice of distance functions