Simplified (fixed?) splitting into groups.