calculatiion of score