Added test
Refactoring, added direct matching to a single file, added test