adding assertions to score function