optimisation to freeGroup() to avoid an O(N^2) pathalogical case