def overlap_between(pair1, pair2):
  """ checks whether there is an overlap between two start/stop position pairs """
  # ensure that start < stop position
  pair1.sort()
  start1, stop1 = pair1
  pair2.sort()
  start2, stop2 = pair2

  if stop1 < start2: return 0
  elif stop2 < start1: return 0
  else: return 1