add the RandomRank logic