In the following code you are returning x.max not y.max.
Tracy Gilmore

Good catch!

One of these days I will learn not to write code in a text editor.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.