We fixed the calculation of the sum in update_sum()