fix bugs, second step of kmeans needs to be fixed, todo:brush