def tupCmp(idHitTup1, idHitTup2):
    """Specialised comparator function; tuples with two entries input. Compares
    based on the score of the second element in each."""
    if idHitTup1[1].getPval() < idHitTup2[1].getPval():
        return -1
    elif idHitTup1[1].getPval() == idHitTup2[1].getPval():
        return 0
    else:
        return 1