improve 'maximum' and 'minimum'