kmeans partial fixes