Calculating the score