Added directory creation. Now existence for distance_matrix dir is checked and.