It's really tedious reading uncommented code with no clue what the author is thinking or doing. Why don't you comment your code?

You're not comparing apples to apples. max does not contain the...