Finished implementing kmeans.