I think this should be enough: int minLevel = Integer.MAX_VALUE; int minScore = Integer.MAX_VALUE; int position = Integer.MAX_VALUE; for (int i=0;i<size;i++){ //find the minimum level if(records[i].getLevel() < minLevel){ minLevel = records[i].getLevel(); minScore = records[i].getScore(); position = i; } //Goes in this if everytime you hit the minLevel if(records[i].getLevel() == minLevel){...