Refactor score calculation.

Still needs work...