final score calculation