kmeans,kmedois implementation