Calculates final scores.