eliminated reset_group, not needed only called in that one place, and small enough to just inline.