Rank detection