public void stats ( int generation, Tree ... trees ) {
        //TODO clean this up
        float average, std, sum = 0;
        for (int i = 0; i < trees.length;i++) {
            sum += trees[i].score;
        }
        average = sum / (float) trees.length;
        sum = 0;
        for (int i = 0; i < trees.length;i++) {
            sum += Math.pow(average - trees[i].score, 2);
        }
        std = (float) Math.sqrt(sum / trees.length);
        
        try {
            if (generation == 0 && 
                    new File(getS("stats")+".txt").exists()) {
                new File(getS("stats")+".txt").delete();
            }
            
            FileWriter fw = new FileWriter(getS("stats")+".txt", true);
            if (generation == 0)
                fw.write("Generation,Best,Average,Standard Dev,Function\n");
            fw.write(generation + "," + Evolve.best.score + "," + average + "," + std + "," + Evolve.best.toString()+"\n");
            fw.close();
        } catch (IOException ex) {
            Logger.getLogger(GPproblem.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        for (int i = 0; i < 3; i++) {
            System.out.println(trees[i].score + " >> " + trees[i].toString());
        }
    }