Trying different way of computing distance matrix.