implemented the score calculator