modify kmeans function bug and so on