implement rank operator