safer totals calculation