MOD move ranking related functions to ranking.go