Adding the distance matrix