Added type scoring function