improved score calculation