fixed a small issue in the scoring function