fix predicates_and_nodes function