distance measurement class and kmeans partitioning fixed