get min_max functions ready