k-means buggy version