query attempt 2 (if statement iffy)