create make_dist_matrix method