update Max and Min functions so that comparing a number with undefined w...

...ill return the number