Added rank calculation to UI