added score function
merged