modify score function