Collpase nested Or and And