add score function but is not complete