It's a little counter-intuitive to be maintaining both max and min when you already have the information available on which one you will need.