elements total function