def METHOD_NAME(casesFilename, controlsFilename, ws, mapOrder, debug):
    casesArpFilename = stripSuffix(casesFilename) + ".arp"
    controlsArpFilename = stripSuffix(controlsFilename) + ".arp"
    casesHaplotypes = genHaplotypes(casesFilename,
                                    casesArpFilename,
                                    ws,
                                    mapOrder,
                                    debug)
    controlsHaplotypes = genHaplotypes(controlsFilename,
                                       controlsArpFilename,
                                       ws,
                                       mapOrder,
                                       debug)
    outputHaploFiles(casesArpFilename, casesHaplotypes)
    outputHaploFiles(controlsArpFilename, controlsHaplotypes)
    # loop through pairs of case, controls, generating contingency tables
    for window in casesHaplotypes:
        freqs, popName, sampleCount, lociList = window
        contingFilename = popName + "-" + lociListSuffix(lociList) + ".conting"
        print("running contingency: " + contingFilename)
        f = open(contingFilename, 'w')
        f.write("Contingency table" + os.linesep)
        f.write("Population: %s" % popName + os.linesep)
        f.write("Loci: %s" % lociListSuffix(lociList) + os.linesep)
        f.write("Number of case samples: %s" % sampleCount + os.linesep)
        f.close()
        os.system("contingency.awk -c %s %s >> %s" \
                  % (genArpFilename(casesArpFilename, lociList), \
                     genArpFilename(controlsArpFilename, lociList),
                     contingFilename))
        recordSummary(open(contingFilename, 'r').readlines(),
                      popName, lociList)