added rank operator and tests