finished basic score function