implemented the scoring method