Made the following changes.
1. Prevent recomputation of updating centroids.
2. Use algorithm='brute' so that sparse data can be handled.