So the logic should be corect. At first I got the right output, but without using the "isGreaterThan" method and intead just using an ArrayList and Collection.sort(). I rewrote the same logic to use the "isGreaterThan" method. But now it doesn t stop from accepting inputs (see code below) Thanks in advance!