corrected if statements