switched upper and lower variables