public void newRandomConnection(Neuron neuron){
        try{
            for(int i=0;i<neurons.size();i++)
                neurons.get(i).findDepth();
        }catch(StackOverflowError e){
            System.out.println("There was a stack overflow because of findDepth :: SpeciationNeuralNetwork");
            new CMDTester(this);
            System.exit(0);
        }
        if(neuron instanceof OutputNeuron){
            mutate();
            return;
        }
        neurons=Neuron.sortByDepth(neurons);
        int index=0;
        for(;index<neurons.size()&&neurons.get(index)!=neuron;index++){}
        int maxRan=(new Random()).nextInt(neurons.size()-index);
        if(maxRan==0){
            // recurrent connection to self
            mutate();
            return;
        }
        if(neuron.existsConnection(neurons.get(index+maxRan))){
            // the connection already exists
            mutate();
            return;
        }
        if(neurons.indexOf(neuron) >= index+maxRan){
            System.out.println("ERROR :: SpeciationNeuralNetwork 211");
        }
        makeConnection(neuron,neurons.get(index+maxRan));
    }