outsource makePopulation and mergePopulations; the latter now works with an arbitrary number of populations