updated the ranking algorithm