Scoring function (mostly for a2)