add the init part of the distance matrix.