added possibility for 'total' output