done method to calculate score.