How to use conditional logic?