public static Pair combine(XYPoint pointsByY[], XYPoint midPoint, Pair closest)	{
		int nPoints = pointsByY.length;
		XYPoint[] YstripTemp = new XYPoint[nPoints];
		int count = 0;
		for (int i = 0; i <= nPoints-1; i++){
			if (Math.abs(pointsByY[i].x - midPoint.x) < closest.getDist()){
				YstripTemp[count] = pointsByY[i];
				count++;
			}
		}
		XYPoint[] yStrip = new XYPoint[count];
		System.arraycopy(YstripTemp, 0, yStrip, 0, count);
		Pair newPair = closest;
		for (int j = 0; j <= yStrip.length - 2;j++){
			int k = j+1;
			while (k<=yStrip.length -1 && (yStrip[k].y - yStrip[j].y)< closest.getDist()){
				Pair tempPair = new Pair(yStrip[j],yStrip[k]);
				newPair = newPair.returnMin(tempPair);
				k++;
			}
		}
		return newPair;
	}