fix to allow us to modify the structure of the grouped table -- need it's own sub routine. Also populate the groupe table on the first run