Implemented findClosestCentroids.