def closestMatch(value, _set):
    """Returns an element of the set that is closest to the supplied value"""
    a = 0
    element = _set[0]
    while(a<len(_set)):
        if((_set[a]-value)*(_set[a]-value)<(element-value)*(element-value)):
            element=_set[a]
        a = a + 1
    return element