How to use conditional Logic Functions