AND OR logic implemented