code: public static boolean reduceFragments(List<FragmentPair> fragments, FragmentPair f, Matrix rmsmat){
  		boolean doNotAdd =false;
  		int i = f.getPos1();
  		int j = f.getPos2();
  
  		for ( int p =0; p < fragments.size(); p++){
  			FragmentPair tmp = fragments.get(p);
  
  			int di1 = Math.abs(f.getPos1() - tmp.getPos1());
  			int di2 = Math.abs(f.getPos2() - tmp.getPos2());
  			if (( Math.abs(di1-di2) == 2)) {
  				double rms1 = rmsmat.get(tmp.getPos1(),tmp.getPos2());
  				double rms2 = rmsmat.get(i,j);
  				doNotAdd = true;
  				if ( rms2 < rms1){
  					fragments.remove(p);
  					fragments.add(f);
  					break;
  				}
  				p = fragments.size();
  			}
  		}
  		return doNotAdd;
  	}
docs: In helices often many similar fragments can be found. To reduce these to a few
  representative ones this check can be used. It does a distance check between
  all known Fragments and a new one. If this one is on a similar diagonal and it
  has a lower rms, this one is a better representation. Note: shifts of one are
  not allowed.
  
  @param fragments
  @param f
  @param rmsmat
  @return true - if this is a better representant for a group of locala fragments.