caculate the score