optimised score calculation