Added in a GroupedVector class to handle the grouped elements used per trial.