add_total_level_to_var function

Add total level to variable