messed-up if statement