and not to be nit picky about it, I'd also pull out the $suppress/display section.

I prefer to make function single purpose only...
but perhaps make a second function to handle the display of the groups if necessary.

But I can see how and why you included it... I would have probably built it that way myself.
_________________________
How to ask questions the smart way <-----------> Before you ask