Kmeans implementation done but needs refactoring.