Adding total_mean atomic function and tests