neww script for clustering