Determining if a set of points is a function