fix up Populate_Groups so that it can be run multiple times and clean up