update score algorithm
update score algorithm