(#297) - Rank algorithm