def _best_length_match(ref_l, cand_l):
	"""Find the closest length of reference to that of candidate"""
	least_diff = abs(cand_l-ref_l[0])
	best = ref_l[0]
	for ref in ref_l:
		if abs(cand_l-ref) < least_diff:
			least_diff = abs(cand_l-ref)
			best = ref
	return best