Added rank detection