compute total value