updated score algorithm