use if-then instead of && and ||