C compare two lists for matches