Made a function object that returns the coalesced groups