fixed adding up the total value