def cmpTup2(tupA, tupB):
    """A comparator function that compares two tuples on the basis of the
    value of their second element."""
    if (tupA[1] < tupB[1]):
        return -1
    elif (tupA[1] == tupB[1]):
        return 0
    else:
        return 1