Replace function about ranking.