public static void writeSVPairs(ArrayList<String> replayStates, NeuralNetworkController nnC) {
        BufferedWriter br = null;
        try {
            br = new BufferedWriter(new FileWriter("training.csv"));
            StateValuePair[] svPairs = getStateValuePairs(replayStates, nnC);
            StateValuePair[] extSvPairs = extendStateValuePairs(svPairs);
            int lncnt = 0;
            for (StateValuePair sv : extSvPairs) {
            	if (lncnt < 4000) {
            		double[] features = sv.getState().getValues();
            		double estimation = sv.getValue();
            		for (int i = 0; i < features.length;i++)
            			br.write(Double.toString(features[i])+",");
            			br.write(Double.toString(estimation));
            			br.newLine();
            	}
            	lncnt++;
            }
        }
        catch (IOException e) {
            System.err.println("Error creating training file");
        }
        finally {
            try { br.close(); } catch (Exception e) { };
        }
    }