add docs explaining how groups are formed