• Don't forget to set the initial value of @val to -1 before each pass, you won't get the correct answers if you don't.

    -d