add logiing, make any() and all() cases equivalent