matching test. Take a look at matching.cpp for details.