Recover rank

Trying to recover old code