public Network bond(Network B, int bondingSiteA, int bondingSiteB){
    
    Network C;
    
    ArrayList<Node> nodesA = this.copyNodes();
    ArrayList<Node> nodesB = B.copyNodes();
    ArrayList<Node> nodesC = new ArrayList<Node>();
    
    
    int numNodesA = this.numNodes;
    int numNodesB = B.getNumNodes();
    int numNodesC = numNodesA + numNodesB;
    
    int numBondingSitesA = this.numBondingSites;
    int numBondingSitesB = B.getNumBondingSites();
    int numBondingSitesC = numBondingSitesA + numBondingSitesB - 2;
    
    int[] bondingSitesA = Arrays.copyOf(this.bondingSites, numBondingSites);
    int[] bondingSitesB = Arrays.copyOf(B.getBondingSites(), B.getNumBondingSites());
    int[] bondingSitesC = new int[numBondingSitesC];
    
    for(int i=0; i<numNodesA; i++){
      
      nodesC.add(new Node(nodesA.get(i)));
    }
    for(int i=0; i<numNodesB; i++){
      int[] temp;
      nodesC.add(new Node(nodesB.get(i)));
      temp = Arrays.copyOf(nodesC.get(i+numNodesA).getInputs(), nodesC.get(i+numNodesA).getInputs().length);
      for(int j=0; j<temp.length; j++){
        temp[j] += numNodesA;
      }
      nodesC.get(i+numNodesA).setInputs(temp);
    }
    
    nodesC.get(bondingSiteA).setBondingInput(numNodesA + bondingSiteB);
    nodesC.get(numNodesA + bondingSiteB).setBondingInput(bondingSiteA);
    
    nodesC.get(bondingSiteA).setBondingSite(false);
    nodesC.get(numNodesA + bondingSiteB).setBondingSite(false);
    
    int j=0;
    for(int i=0; i<numBondingSitesA; i++){
      
      if(bondingSitesA[i] != bondingSiteA){
        bondingSitesC[j] = bondingSitesA[i];
        j++;
      }
    }
    for(int i=0; i<numBondingSitesB; i++){
      
      if(bondingSitesB[i] != bondingSiteB){
        //System.out.printf("J:  %d\n#A:   %d\n#B:   %d\n#C:   %d\n", j,numBondingSitesA,numBondingSitesB, numBondingSitesC);
        bondingSitesC[j] = bondingSitesB[i]+numNodesA;
        j++;
      }
    }
    
    C = new Network(nodesC, bondingSitesC);
    C.calculateCycleLength();
    C.calculateActivity();
    return C;
    
  }