added fields_to_dict to check the number of clusters written to file