calculate average score.