added && and || logic