code and tests for .withor