optimized k-means init commit