order of operations corrected for radiobutton checkbox mode