computeScore Function