code: private Group getNextGroup(int tmp_model,int tmp_chain,int tmp_group)
  	throws NoSuchElementException
  	{
  
  		if ( tmp_model >= structure.nrModels()){
  			throw new NoSuchElementException("arrived at end of structure!");
  		}
  
  		List<Chain> model = structure.getModel(tmp_model);
  
  		if ( tmp_chain >= model.size() ){
  			if(fixed_model)
  				throw new NoSuchElementException("arrived at end of model!");
  			return getNextGroup(tmp_model+1,0,0);
  		}
  
  		Chain     chain = model.get(tmp_chain);
  
  		if (tmp_group  >= chain.getAtomLength()){
  			// start search at beginning of next chain.
  			return getNextGroup(tmp_model,tmp_chain+1,0);
  		} else {
  			current_model_pos = tmp_model;
  			current_chain_pos = tmp_chain;
  			current_group_pos = tmp_group;
  			return chain.getAtomGroup(current_group_pos);
  		}
  
  	}
docs: recursive method to retrieve the next group. Helper
  method for gext().
  @see #next