public ArrayList<Integer> getAdjacentNeurons(int neuronNumber) {
        ArrayList<Integer> connectedNeurons = new ArrayList<Integer>();
        int top = -1 ,left = -1,right = -1,bottom = -1;
        if ((neuronNumber < colNumber * rowNumber) && (neuronNumber >= 0)){
        	//up
            if (neuronNumber - colNumber >= 0) {
                top = neuronNumber - colNumber;
                connectedNeurons.add(top);
            }
            //left
            if ((neuronNumber - 1 >= 0) && ((neuronNumber % colNumber) != 0)) {
            	left = neuronNumber - 1;
                connectedNeurons.add(left);
            }
            //right
            if ((neuronNumber + 1 < colNumber * rowNumber)
                    && (((neuronNumber + 1) % colNumber) != 0)) {
            	right = neuronNumber + 1;
                connectedNeurons.add(right);
            }
            //down
            if (neuronNumber + colNumber < colNumber * rowNumber) {
            	bottom = neuronNumber + colNumber;
                connectedNeurons.add(bottom);
            }
        }
      return connectedNeurons;   
    }