@Override
    public Object[] crossover(List<Individual> parents){
        for (Individual parent: parents){
            if (!(parent instanceof Individual)){
                try{
                    throw new Exception("Parent incorrect class?");
                }catch(Exception e){
                    e.printStackTrace();
                }
            }
        }
        String[] recombined = new String[2];
        recombined[0] = "";
        recombined[1] = "";
        if (Math.random() <= recombinationRate){
            String gene1 = parents.get(0).getGenes().toString();
            String gene2 = parents.get(1).getGenes().toString();
            Random rand = new Random();
            if (recombinationSplit == 1){
                int split = 1 + rand.nextInt(gene1.length() - 2);
                recombined[0] += gene1.substring(0, split) + 
                        gene2.substring(split);
                recombined[1] += gene2.substring(0, split) + 
                        gene1.substring(split);
            }else if (recombinationSplit == 2){
                int split1 = 1 + rand.nextInt((gene1.length() - 2) / 2);
                int split2 = ((gene1.length() / 2) + 1) + 
                        rand.nextInt((gene1.length() - 2) / 2);
                recombined[0] += gene1.substring(0, split1) + 
                        gene2.substring(split1, split2) + 
                        gene1.substring(split2);
                recombined[1] += gene2.substring(0, split1) + 
                        gene1.substring(split1, split2) + 
                        gene2.substring(split2);
            }
        }else{
            recombined[0] = parents.get(0).getGenes().toString();
            recombined[1] = parents.get(1).getGenes().toString();
        }
        return recombined;
    }