def hit_location_cmp(hit1, hit2):
    """
    Is the location of hit1 before the location of hit2? Used to sort hits.
    """
    diff = hit1.location.start() - hit2.location.start()
    return 0 != diff and diff or hit1.location.end() - hit2.location.end()