public static void merge(ArrayList<Integer> arr, int left, int center, int right){
		int first1 = left;
		int last1 = center;
		int first2 = center + 1;
		int last2 = right;
		ArrayList<Integer> b =  new ArrayList<Integer>();
		while((first1 <= last1) && (first2 <= last2)){
			if(arr.get(first1) < arr.get(first2)){
				b.add(arr.get(first1));
				first1 = first1 + 1;
			}else{
				 b.add(arr.get(first2));
			     first2 = first2 + 1;
			     inversion_counter = inversion_counter + 1 + last1 - first1;
			}			     
		}
		
		while (first1 <= last1){
			b.add(arr.get(first1));
		    first1 = first1 + 1;
		}
		
		while (first2 <= last2){
			b.add(arr.get(first2));
		    first2 = first2 + 1;
		}
		
		int index_arr = left;
		for (int i = 0; i < b.size(); i ++){
			arr.set(index_arr,b.get(i));
			index_arr++;
		}		
	}