introduce min max to group