fix float division by zero bug in score calculation