Added determineRank function definition