One way to see what the code is doing is to add println statements just before the if statement, that print out the values of: vote, paintings[i], i and total so you can see what the computer sees...