fixed the clustering scripts