code: public static final Atom[] getAtomArray(Atom[] ca,List<Group> hetatms ) throws StructureException{
  		List<Atom> atoms = new ArrayList<Atom>();
  		Collections.addAll(atoms, ca);
  
  		logger.debug("got {} hetatoms", hetatms.size());
  
  		// we only add atom nr 1, since the getAlignedStructure method actually adds the parent group, and not the atoms...
  		for (Group g : hetatms){
  			if (g.size() < 1)
  				continue;
  			//if (debug)
  			//   System.out.println("adding group " + g);
  			Atom a = g.getAtom(0);
  			//if (debug)
  			//  System.out.println(a);
  			a.setGroup(g);
  			atoms.add(a);
  		}
  
  		Atom[] arr = atoms.toArray(new Atom[atoms.size()]);
  
  		return arr;
  	}
docs: Returns the first atom for each group
  @param ca
  @param hetatms
  @return
  @throws StructureException