Added scoring function