developing loop that only adds new groups
function ensures groups are unique