add word score function