Simplifying predicate algo for take, while