added score function