completed the calculation of appropriate ranks