Added cod for clustering