kMeans implementation in Java