Probable solution to generating filter predicate

Test for sort giving false. have to check