score function added