Generating subgroups with a script