Added count of template sentences to template scoring code