added code to save output from each cluster-set