reputation_score function