public double[] sweepPseudoRehearsalSerialLearning(double[][] baseinputs, double[][] baseoutputs, 
			double[][] serialinputs, double[][] serialoutputs, double maxerror, int popSize, int bufferSize, boolean reals, double minrange, double maxrange) {
		double[] outputs = new double[serialinputs.length + 1];// new double[2];///////////////////	
		double error = maxerror + 1;
		
		// train base population
		int cutoff = 0;
		while (maxerror < error && cutoff++ < quitCounter) {
			for (int i = 0; i < baseinputs.length; i++) {
				Pattern trial = new Pattern(baseinputs[i], baseoutputs[i]);
				pass(trial);
				updateAllWeights(trial);
			}
			error = populationError(outputs(baseinputs), baseoutputs);
		}
		outputs[0] = error; ///////////////////
		if (cutoff>=quitCounter) { /*System.err.println("counter exceeded  PS");*/ }  else {
			//System.out.println("Learned within " + cutoff + " epochs.");
		}
		//outputs[0] = cutoff;///////////////////
		
		double[][] pseudoinputs = new double[popSize][baseinputs[0].length];
		double[][] pseudooutputs = new double[popSize][baseoutputs[0].length];
		
		makepseudopop(pseudoinputs, pseudooutputs, reals, minrange, maxrange);
		
		for (int i = 0; i < serialinputs.length; i++) {
			double[][] rehearseinputs = new double[bufferSize + 1][serialinputs[i].length];
			double[][] rehearseoutputs = new double[bufferSize + 1][serialoutputs[i].length];
			rehearseinputs[rehearseinputs.length-1] = serialinputs[i];
			rehearseoutputs[rehearseoutputs.length-1] = serialoutputs[i];

			error = maxerror + 1;
			cutoff = 0;
			while (maxerror < error && cutoff++ < quitCounter) {
				
				selectpop(rehearseinputs, rehearseoutputs, rehearseinputs.length-1, pseudoinputs, pseudooutputs);
				
				for (int j = 0; j < rehearseinputs.length; j++) {
					Pattern trial = new Pattern(rehearseinputs[j], rehearseoutputs[j]);
					pass(trial);
					updateAllWeights(trial);
				}
				error = patternError(getCurrentOutput(), 
						rehearseoutputs[rehearseoutputs.length-1]); //CHANGED!!! CHANGED!!!!
			}
			double poperror = populationError(outputs(baseinputs), baseoutputs);
			outputs[i+1] = poperror; ///////////////////
		}
		if (cutoff>=quitCounter) { /*System.err.println("counter exceeded quitCounter PS");*/ }  else {
			//System.out.println("Learned within " + cutoff + " epochs.");
		}
		//outputs[1] = cutoff;///////////////////
		return outputs;
	}