fixed syntax error in score function