CreateScoreFun function

Create a score function for use in a pim.