if (NON_EMPTY_SELECTION)
{
	data_rows  	 = Columns 	(SELECTED_CHART_ROWS);

	if (data_rows % 2 == 0)
	{
		temp = -1;
		data_columns = -1;
		
		for (count = 0; count<data_rows; count = count+1)
		{
			temp2 = SELECTED_CHART_COLS[count];
			if (temp<0)
			{
				temp = temp2;
			}
			else
			{
				if (temp!=temp2)
				{
					if (data_columns<0)
					{
						data_columns = temp2;
					}
					else
					{
						if (temp2!=data_columns)
						{
							break;
						}
					}
				}
			}
		}
		
		if ((count == data_rows)&&(data_columns>=0)&&(temp>=0))
		{
			for (count = 0; count < data_rows; count = count+2)
			{
				if (SELECTED_CHART_ROWS[count]!=SELECTED_CHART_ROWS[count+1])
				{
					break;
				}
			}
			if (count==data_rows)
			{
			
				SELECTED_CHART_ROWS = {2,data_rows/2};
				for (count = 0; count < data_rows; count = count+2)
				{
					SELECTED_CHART_ROWS[0][count/2]=SELECTED_CHART_DATA[count];
					SELECTED_CHART_ROWS[1][count/2]=SELECTED_CHART_DATA[count+1];
				}
				SELECTED_CHART_DATA = SELECTED_CHART_ROWS;
				sumVec = {Columns(SELECTED_CHART_DATA),1};
				
				for (count = Columns(SELECTED_CHART_DATA)-1; count >=0 ; count = count - 1)
				{
					sumVec[count] = 1;
				} 
				
				scd = SELECTED_CHART_DATA;
				fprintf (stdout, "How many samples should be generated?");
				fscanf  (stdin, "Number", samples);
				resampledLRT = {samples,3};
				for (count = 0; count < samples; count = count + 1)
				{
					resampled = Random(SELECTED_CHART_DATA,1)*sumVec;
					resampledLRT[count][0] = resampled[0];
					resampledLRT[count][1] = resampled[1];
					resampledLRT[count][2] = resampled[1]-resampled[0];
				}
				
				labels = {{"Model_1", "Model_2", "Model_2 - Model_1"}};


				OpenWindow (CHARTWINDOW,{{"Resampled LRT"}
					{"labels"}
					{"resampledLRT"}
					{"Bar Chart"}
					{"Index"}
					{labels[2]}
					{"Index"}
					{"LRT"}
					{"LRT"}
					{""}
					{""}
					{""}
					{"10;1.309;0.785398"}
					{"Times:12:0;Times:10:0;Times:14:2"}
					{"0;0;16777215;5000268;0;0;6750054;11842740;13158600;14474460;0;3947580;16777215;0;5000268;11776947;10066329;9199669;7018159;1460610;16748822;11184810;14173291"}
					{"16"}
					},
					"SCREEN_WIDTH-150;SCREEN_HEIGHT-150;100;100");

				return;
			}
		}
	}

	fprintf (stdout, "Please select two columns of data.\n");
}
else
{
	NON_EMPTY_SELECTION = -1;
}
