switched avg variables