Actually use min instead of max