updated the group sequence to total