Implemented score calculation.