modified clustering_algorithm file