fixed all cases but unit tests still needed because w3 tests are invalid