private double findMedianFitness() {
        //before calculate fitness for all organisms
        /*for (int i = 0; i < organisms.size(); i++) {
         organisms.get(i).countFitnessOut();
         }
         //*/
        sortByFitness();
        
        double length = getOrganisms().size();
        double median;
        
        if (length % 2 == 0) {
            median = (getOrganisms().get((int)length/2).getFitness() + 
                    getOrganisms().get((int)length/2 - 1).getFitness()) / 2;
        } else {
            median = getOrganisms().get((int)length/2).getFitness();
        }

        return median;
    }