fixed up the if statements