program now successfully checks for matches