private int[][] recombine(int[] g1, int[] g2) {
		int[] newG1 = new int[g1.length];
		int[] newG2 = new int[g2.length];
		
		// Choose the crossover position.
		int position = (int)(Math.random()*g1.length);
		
		// The new genomes contain one of the originals before the crossover,
		// and the other after.
		for (int i = 0; i < position; i++) {
			newG1[i] = g1[i];
			newG2[i] = g2[i];
		}
		for (int i = position; i < g1.length; i++) {
			newG1[i] = g2[i];
			newG2[i] = g1[i];
		}
		
		// Randomly mutate the new genomes.
		for (int i = 0; i < g1.length; i++) {
			if (Math.random() < mutationRate) {
				if (i % 2 == 0) {
					newG1[i] = (int)(Math.random()*4);
				} else {
					newG1[i] = (int)(Math.random()*16);
				}
			}
			if (Math.random() < mutationRate) {
				if (i % 2 == 0) {
					newG2[i] = (int)(Math.random()*4);
				} else {
					newG2[i] = (int)(Math.random()*16);
				}
			}
		}
		return new int[][]{newG1, newG2};
	}