First working version of kmeans algorithm in apache spark