protected boolean disconnectOutput(NeuralConnection o, int n) {
    
    int loc = -1;
    boolean removed = false;
    do {
      loc = -1;
      for (int noa = 0; noa < m_numOutputs; noa++) {
	if (o == m_outputList[noa] && (n == -1 || n == m_outputNums[noa])) {
	  loc =noa;
	  break;
	}
      }
      
      if (loc >= 0) {
	for (int noa = loc+1; noa < m_numOutputs; noa++) {
	  m_outputList[noa-1] = m_outputList[noa];
	  m_outputNums[noa-1] = m_outputNums[noa];

	  //set the other end to have the right connection number
	  m_outputList[noa-1].changeInputNum(m_outputNums[noa-1], noa-1);
	}
	m_numOutputs--;
	removed = true;
      }
    } while (n == -1 && loc != -1);
    
    return removed;
  }