private void nonGenerationalCrossover(int[] parents) {
        int crossoverPoint = rand.nextInt(geneSize);
        int[][] children = new int[2][geneSize];
        int[] child = new int[geneSize];
        int leftIndex = 0;
        int rightIndex = 0;
        if(rand.nextInt(10000) > 10000/2) {
            leftIndex = 0;
            rightIndex = 1;
        } else {
            leftIndex = 1;
            rightIndex = 0;
        }
        for (int i = 0; i < crossoverPoint; i++) {
            children[0][i] = population[parents[leftIndex]][i];
            children[1][i] = population[parents[rightIndex]][i];
        }
        for (int i = crossoverPoint; i < geneSize; i++) {
            children[1][i] = population[parents[rightIndex]][i];
            children[1][i] = population[parents[leftIndex]][i];
        }
        for (int i = 0; i < children.length; i++) {
            children[i] = mutate(children[i]);
        }

        int[][] chromosomes = new int[][] {children[0], children[1], population[parents[0]], population[parents[1]]};
        double[] fitnessNew = new double[4];
        fitnessNew[2] = fitness[parents[0]];
        fitnessNew[3] = fitness[parents[1]];
        for (int i = 0; i < chromosomes.length; i++) {
            fitnessNew[i] = calculateFitness(chromosomes[i]);
        }
        int[][] chromosomesNew = findBestChildren(chromosomes, fitnessNew);
        for (int i = 0; i < chromosomesNew.length; i++) {
            population[parents[i]] = chromosomesNew[i];
        }
    }