corrected ifs