score update logic