added logic for logic predicates