changed points to array of x,y pairs