fixed a few bugs in the grouping functions
fixed a few bugs in the grouping functions

matthewphilyaw/lunchtime-katas,matthewphilyaw/lunchtime-katas,matthewphilyaw/lunchtime-katas,matthewphilyaw/lunchtime-katas