Added cache and documented RANKING_LENGTH