add total functions