CHANGED:applied the KMeans function;