mod. Use a generator to return cohort IDs.  They may be fairly large and the option not to store the entire set in memory is useful.