def min_x_pt(pt_dict):
    """Returns the key of the point at minimum x 
    (with minimum y) in the XY plane (Z is ignored)
    pt_dict is a collection of 'pt_ID: (x, y, z)'
    key-value pairs"""
    nmin = (9.9E12, 9.9E12)
    the_node = None
    for k,v in pt_dict.items():
        if v[0] == nmin[0]:
            if v[1] < nmin[1]:
                the_node = k
                nmin = (v[0], v[1])
        elif v[0] < nmin[0]:
            the_node = k
            nmin = (v[0], v[1])
    return the_node