Fixing the if statements