parameterize min and max