calculate ranking before printing rankinglist