cleaned the test code
inlined the various predicates