BTW, I think we need to explain the meaning of each variables, like groups, internal_groups.