moved score function into scorer function