public static void crossover(Deck[] result, int position, Deck[] source, float[] perf, float total){
	Deck a = selectOne(source, perf, total);
	Deck b = selectOne(source, perf, total);
	
	if(Math.random() < Zegana.crossoverChance){
	    //We want to interchange the substring posa1:posa2 (inclusive) in a
	    //with the corresponding substring in b.
	    int posa1 = (int) (Math.random() * (1+a.cards.size()));
	    int posa2 = (int) (Math.random() * (1+a.cards.size()));
	    int posb1 = (int) (Math.random() * (1+b.cards.size()));
	    int posb2 = (int) (Math.random() * (1+b.cards.size()));
	    if(posa1>posa2){
		int temp = posa1;
		posa1 = posa2;
		posa2 = temp;
	    }
	    if(posb1>posb2){
		int temp = posb1;
		posb1 = posb2;
		posb2 = temp;
	    }

	    List<String> prefa = a.cards.subList(0, posa1);
	    List<String> midla = a.cards.subList(posa1, posa2);
	    List<String> sufxa = a.cards.subList(posa2, a.cards.size());
	    
	    List<String> prefb = b.cards.subList(0, posb1);
	    List<String> midlb = b.cards.subList(posb1, posb2);
	    List<String> sufxb = b.cards.subList(posb2, b.cards.size());

	    List<String> an = new ArrayList<String>();
	    an.addAll(prefa);
	    an.addAll(midlb);
	    an.addAll(sufxa);
	    a.cards = an;

	    List<String> bn = new ArrayList<String>();
	    bn.addAll(prefb);
	    bn.addAll(midla);
	    bn.addAll(sufxb);
	    b.cards = bn;

	    String tempa = a.name;
	    String tempb = b.name;

	    a.name = '('+tempa+'.'+tempb+')';
	    b.name = '('+tempb+'.'+tempa+')';

	    if(a.name.length() > 1000)
		a.name = 'r' + Integer.toString((int ) (Math.random()*100)) + '-' + a.name.length();


	    if(b.name.length() > 1000)
		b.name = 'r' + Integer.toString((int ) (Math.random()*100)) + '-' + b.name.length();
	}

	result[position] = a;
	if(position+1 < result.length)
	    result[position+1] = b;
	
	return;
    }