fixed the score calculation