Fix logical error

Use relative rank instead of absolute