Added function to calculate a user's current rank.