Modifies erGrouping function to allow using different grouping implementations and updates the current grouping algorithm to it's latest version