public ArrayList<Double> update(ArrayList<Double> input) {

        //first check that we have the correct amount of inputs
        if (input.size() != numInputs)
        {
            // return null if incorrect input
            return null;
        }

        ArrayList<Double> output = null;

        //For each layer....
        for (int i=0; i<numHiddenLayers + 1; ++i)
        {
            if ( i > 0 )
            {
                input = output;
            }

            output = new ArrayList<Double>();

            int cWeight = 0;

            //for each neuron sum the (inputs * corresponding weights).Throw
            //the total at our sigmoid function to get the output.
            for (int j=0; j< layers.get(i).numNeurons; ++j)
            {
                double netInput = 0;

                int numInputs = layers.get(i).neurons[j].numInputs;

                //for each weight
                for (int k=0; k<numInputs - 1; ++k)
                {
                    //sum the weights x inputs
                    netInput += layers.get(i).neurons[j].weights[k] *
                            input.get(cWeight++);
                }

                //add in the bias
                netInput += layers.get(i).neurons[j].weights[numInputs-1] *
                        dBias;
                //we can store the outputs from each layer as we generate them.
                //The combined activation is first filtered through the sigmoid
                //function
                output.add(sigmoid(netInput,
                        dActivationResponse));

                cWeight = 0;
            }
        }

        return output;
    }