got all tests to pass with new matching code