Correct ranking logic

We were getting correct answers when there were consecutive equal
values.