Adds scores to template and scoring function.