public double calculate(Accession a1, Accession a2) {
	double value = getMemoizedValue(a1.getId(), a2.getId());
	if (value != MISSING_VAL) {
	    return value;
	}

	ListIterator<List<Double>> m1Itr = a1.getSSRValues().listIterator();
	ListIterator<List<Double>> m2Itr = a2.getSSRValues().listIterator();
	
	double markerCnt = 0;
	double sumMarkerSqDiff = 0;
	while (m1Itr.hasNext() && m2Itr.hasNext()) {
	    ListIterator<Double> a1Itr = m1Itr.next().listIterator();
	    ListIterator<Double> a2Itr = m2Itr.next().listIterator();
	    
	    double markerSqDiff = 0;
	    while (a1Itr.hasNext() && a2Itr.hasNext()) {
		Double Pxla = a1Itr.next(); 
		Double Pyla = a2Itr.next();
		
		if( Pxla != null && Pyla != null ) {
		    double sqrtDiff = Math.sqrt(Pxla) - Math.sqrt(Pyla);
		    markerSqDiff += (sqrtDiff) * (sqrtDiff);
		}
	    }
	    
	    sumMarkerSqDiff += markerSqDiff;
	    markerCnt++;
	}
	
	value = 1.0/(Math.sqrt(2.0 * markerCnt))*Math.sqrt(sumMarkerSqDiff);
	setMemoizedValue(a1.getId(), a2.getId(), value);
	return value;
    }