Another implementation of Kmeans