more robust calculation of partition from possibly overlapping groups, and check...