Data science

See my comment about renaming the method `all_group_types`. That would make line 41 read like `cohorts.each do |cohort|`. Then you will be passing `cohort` to each of your other methods instead of `group`.