anchor.diff:     HNFin = 0 ! Load up the HNF with the elements that were read in.
      HNFin(1,1,1) = a; HNFin(2,1,1) = b; HNFin(2,2,1) = c;
      HNFin(3,1,1) = d; HNFin(3,2,1) = e; HNFin(3,3,1) = f;
  -
  -! Why are we doing this? To get the dRotList? We only have one HNF, so there are no duplicates to remove...
  +! Check to see if this case is "equiatomic", that is, whether or not the number of labels of each
  +! color is exactly the same. If so, we need some extra logic when two labeling are compared
  +! (see email discussion with Rod Forcade on May 16 2019, subject: "Monk?")
  +   equiatomic = .false.
  +   if (mod(n,k)== 0) then ! necessary but not sufficient condition for equiatomic.
  +      equiatomic = .true.
  +      do i = 0, k-1
  +         cDigits = 0
  +         do j = 1, n
  +            print*,'char',char(i)
  +            ! if (labeling(j)==char(i)) then
  +            !    cDigits = cDigits + 1
  +            ! endif
  +         enddo
  +         if (cDigits /= n/k) then ! can't be equiatomic
  +            print*,"Not equiatomic"
  +            equiatomic = .false.
  +            exit
  +         endif
  +      enddo
  +   endif
  +
  +! Why are we doing this? To get the dRotList? We only have one HNF, so there are no duplicates to
  +! remove...
      call remove_duplicate_lattices(HNFin,LatDim1,pLV1,rot,shift,dset1,dRotList1,HNFout,fixOp,&
                                     LattRotList1,sLVlist,degen_list,eps)
      open(17,file="debug_rotation_permutations.out")
  
positive.code:       if (lc > 100) stop "Didn't find the 'start' tag in the second file"
     enddo
     iStr2 = 0
     ! The trouble, subtle bug was that one of the routines from derStrGen was opening another file with unit number 11
     ! this was clashing with th unit 11 that as being opened here..
     compareloop: do
        write(*,'("Compare loop: file1 strN ",i6)') strN
        write(13,'("Compare loop: file1 strN ",i6)') strN
        iStr2 = iStr2 + 1
        !write(*,'("iStr2: ",i4)') iStr2
        read(f2,*,iostat=ioerr) strN2, hnfN2, hdgenfact, labdgen, totdgen, sizeN, n2, pgOps2, diag2, a,b,c,d,e,f, L2(:,:,1), labeling
  !      read(f2,*,iostat=ioerr) strN2, hnfN2, hdgenfact, labdgen, totdgen,  idx2, n2,  pgOps2, diag2, a,b,c,d,e,f, L2(:,:,1), labeling
        write(*,'("read from file 2: strN2:",i5)') strN2
        if(ioerr/=0) exit
        read(labeling,'(500i1)') ilabeling2
        L2(:,:,1) = transpose(L2(:,:,1)) ! Written out column-wise but read in row-wise. So fix it by transposing
        if (any(L1/=L2)) then
           !make the qlabel list of permutations
           call get_dvector_permutations(pLV2,dset2,nD2,rot,shift,dRotList2,LatDim2,eps)
  
negative.code: !logical                   :: conc_check
  integer, pointer          :: degen_list(:)
  integer, pointer          :: rotProdLab(:)
  integer, pointer          :: labPerms(:,:)
  
  SNF = 0
  allocate(HNFin(3,3,1))
  