fixes #51 with just adding an additional parameter in the big loop if
one or two groups are removed in one run of the group search loop