Ported matching to binary matching, removed old stuff