Vector3f vAC = new Vector3f();
for (int i = monomerCount; --i >= 0;) {
NucleicMonomer myNucleotide = (NucleicMonomer) monomers[i];
if (!myNucleotide.isPurine())
continue;
Atom myN3 = myNucleotide.getN3();
boolean isInA = bsA.get(myN3.index);
if (!isInA && !bsB.get(myN3.index))
continue;
Atom myN1 = myNucleotide.getN1();
Atom myN9 = myNucleotide.getN0();
Point4f plane = Measure.getPlaneThroughPoints(myN3, myN1, myN9, vNorm,
vAB, vAC);
Atom bestN3 = null;
float minDist2 = 25;
NucleicMonomer bestNucleotide = null;
for (int j = other.monomerCount; --j >= 0;) {
NucleicMonomer otherNucleotide = (NucleicMonomer) other.monomers[j];
if (!otherNucleotide.isPyrimidine())
continue;
Atom otherN3 = otherNucleotide.getN3();
if (isInA ? !bsB.get(otherN3.index) : !bsA.get(otherN3.index))
continue;
Atom otherN1 = otherNucleotide.getN0();
float dist2 = myN1.distanceSquared(otherN3);
if (dist2 < minDist2 && myN9.distanceSquared(otherN1) > 50 // not stacked
&& Math.abs(Measure.distanceToPlane(plane, otherN3)) < 1 // in plane
) {
bestNucleotide = otherNucleotide;