added some predicate logic