DistanceMatrix implemented