public String[] insertionSort(String[] arreglo, String[] targets){

		int aux, j;
		String aux2;
		int[] positions = new int[arreglo.length];
		ArrayList<String> fill = new ArrayList<String>(1);

		// array of indexs
		for (int i=0; i<positions.length; i++)
			for (int k=0; k<targets.length; k++)
				if(arreglo[i].equals(targets[k]))
					positions[i] = k;

		// insertion sort
		for (int i=1; i<positions.length; i++) {
			aux = positions[i];
			aux2 = arreglo[i];					// fix
			j = i-1;
			while (j>=0 && positions[j]>aux){
				positions[j+1] = positions[j];
				arreglo[j+1] = arreglo[j];		// fix
				j = j-1;
			}
			positions[j+1] = aux;
			arreglo[j+1] = aux2;
		}

		aux2 = "";
		// remove repeated stages
		for (int i=0; i<arreglo.length; i++) {
			if (aux2.equals(arreglo[i]));
			else
				fill.add(arreglo[i]);

			aux2 = arreglo[i];

		}

		// list to array
		String[] a = new String[fill.size()];
		for (int i=0; i<fill.size(); i++) {
			a[i] = fill.get(i);
		}

		// done
		return a;
		
	}