def METHOD_NAME(args):
	map = getMappedAccessions(args.mappedfilename)
	unmapped = getUnmappedAccessions(args.unmappedfilename,map)
	nbatches = len(unmapped)/args.batchsize
	# for i in range(nbatches):
	for i in range(args.maxbatches):
		start = i*args.batchsize
		end = min(start+args.batchsize,len(unmapped))
		if end > start:
			try:
				map=do_one_batch(unmapped[start:end],map)
			except IOError:
				quit()
			time.sleep(1)
	# Write out all of the mappings, both old and new.
	outfile = open(args.outputfile,"w")
	for accid in map.iterkeys():
		outfile.write("%s\t%s\n"%(accid, map[accid]))
	outfile.close()