code: private static void cloneAtomRange(Atom[] p1, Atom[] p2, int r1, int r2)
  			throws StructureException {
  
  		logger.debug("modifyCod from: {} to: {}", r1, r2);
  
  		// special clone method, can;t use StructureTools.cloneCAArray, since we
  		// access the data
  		// slightly differently here.
  		List<Chain> model = new ArrayList<Chain>();
  		for (int i = r1; i < r2; i++) {
  
  			Group g = p2[i].getGroup();
  			Group newG = (Group) g.clone();
  
  			p1[i] = newG.getAtom(p2[i].getName());
  			Chain parentC = g.getChain();
  
  			Chain newChain = null;
  
  			for (Chain c : model) {
  				if (c.getName().equals(parentC.getName())) {
  					newChain = c;
  					break;
  				}
  			}
  
  			if (newChain == null) {
  				newChain = new ChainImpl();
  				newChain.setName(parentC.getName());
  				model.add(newChain);
  			}
  
  			newChain.addGroup(newG);
  
  		} // modify caCod
  
  	}
docs: orig name: modifyCod