Working on processing distance matrix.