Use a std::map so that we record the group ID.