updated score calculation