AND working for arbitrary conditions