public static int[] mergeSort(int[] array)
	{
		if (array.length==1) return array;
		
		int mid = (array.length) / 2;
		
		int[] low = new int[mid];
		int[] high = new int[array.length-mid];
		
		for (int i=0;i<array.length;i++)
		{
			if (i<mid)
			{
				low[i]=array[i];
			}
			else
			{
				high[i-mid]=array[i];
			}
		}
			
		
		low = mergeSort(low);
		high = mergeSort(high);
		
		int[]ordered = new int[array.length];
	
		int i=0;
		int j=0;
		
		while ((i<low.length)&&(j<high.length))
		{
			if (low[i]<=high[j])
			{
				ordered[i+j]=low[i];
				i++;
			}
			else
			{
				ordered[i+j]=high[j];
				j++;
			}
		}
	
		while (i<low.length)
		{
			ordered[i+j]=low[i];
			i++;
		}
		
		while (j<high.length)
		{
			ordered[i+j]=high[j];
			j++;
		}
		
		
		return ordered;
	}