moved scoring function to allow easier profilling
created scoring function to allow easier profilling