Yet another KMeans implementation