each_cluster function