calculating the total.