fixed bug in score calculation