rendered paste body// here is maybe the most ugly part there can be ;D for(int x=0;x<plrs;x++){ for(int i=0;i<=x;i++){ if(score[x]>tmpscr[i]){ for(int j=plrs-1;j>=i;j=j-1){ tmpscr[j+1]=tmpscr[j]; tmpnmn[j+1]=tmpnmn[j]; tmpVoted[j+1]=tmpVoted[j]; tmpScBef[j+1]=tmpScBef[j]; tmpTimesWon[j+1]=tmpTimesWon[j]; tmpScored[j+1]=tmpScored[j]; tmpBestAvgs[j+1]=tmpBestAvgs[j]; for(int kk=0;kk<10;kk++) tmpAvg[j+1][kk]=tmpAvg[j][kk]; } tmpscr[i]=score[x]; tmpBestAvgs[i]=bestAvgs[x]; tmpnmn[i]=name[x]; tmpVoted[i]=hasVoted[x]; tmpScBef[i]=scoreBefore[x]; tmpTimesWon[i]=timesWon[x]; tmpScored[i]=scored[x]; for(int kk=0;kk<10;kk++) tmpAvg[i][kk]=avg[x][kk]; break; } } } for(int i=0;i<plrs;i++){ name[i]=tmpnmn[i]; score[i]=tmpscr[i]; hasVoted[i]=tmpVoted[i]; scoreBefore[i]=tmpScBef[i]; timesWon[i]=tmpTimesWon[i]; scored[i]=tmpScored[i]; bestAvgs[i]=tmpBestAvgs[i]; for(int kk=0;kk<10;kk++) avg[i][kk]=tmpAvg[i][kk]; } //parsar över tmp till riktiga listan }part 2: another excerpt :P public String[] getAverageTop3(){ String[] str = new String[3]; str[0] = ""; str[1] = ""; str[2] = ""; try{ String[] tmpNmn = new String[1000]; for(int i = 0;i<1000; i++) tmpNmn[i] = name[i]; double max; for(int i = 0; i<3; i++){ max = 0; int pos = 0; for(int j=0; j<1000; j++){ if (tmpNmn[j] == null) break; if (!tmpNmn[j].equals("...")){ if(max < getAvg(j)) { max = getAvg(j); str[i] = tmpNmn[j]; pos = j; } } } tmpNmn[pos] = "..."; } }catch (Exception e){sendMessage(chan,Colors.RED+"ERROR in getAverageTop3() "+e);} return str; }