private void updateLocalTreesCorrelation(Genealogy genealogy) throws NaturalSetException {
		HashMap<NaturalSet, NaturalSetCollection>  localTreesBiPartitions = genealogy.localTreesBiPartitions();
		ArrayList<NaturalSet> frames = new ArrayList<NaturalSet>(localTreesBiPartitions.keySet());
		Collections.sort(frames);
		
		for(NaturalSet x : frames){
			for(NaturalSet y : frames){
				if(x.compareTo(y) >= 0){
					NaturalSetCollection xbp = localTreesBiPartitions.get(x);
					NaturalSetCollection ybp = localTreesBiPartitions.get(y);
					int value = xbp.intersectCount(ybp);
					
					if(env().stringProperty("DistanceMetric").equals("bs")){
						value = xbp.size() + ybp.size() - haplotypeDomain().cardinality() - value;
					}
					
					int xmin = x.min(), xmax = x.max(), ymin = y.min(), ymax = y.max();
					for(int i=xmin; i<=xmax; i++){
						for(int j=ymin; j<=ymax && j<=i; j++){
							if(snpDomain.contains(i) && snpDomain.contains(j)){
								treeCorrelationCount[snpDomain.toRelativeCoordinate(i)][snpDomain.toRelativeCoordinate(j)] += value;
							}
						}
					}					
				}
			}
		}
	}