fixed extractAndMatch a bit, no tests written yet