total function

total function