Added java file for clustering, fixed \n in centroid file fixed