anchor.diff:  implicit none
   character(80) fname, title, strname, strNstring
   character(maxLabLength) :: labeling
  -integer ioerr, iline, ic, i, ilab, pgOps, nD, hnfN, iAt
  -integer k, strN, istrN, strNi, strNf, sizeN, n, diag(3), a,b,c,d,e,f, HNF(3,3), L(3,3), hnf_degen, lab_degen, tot_degen
  +integer ioerr, iline, ic, i, ilab, pgOps, nD, hnfN, iAt, jAt, iSpec, nSpec
  +integer k, strN, istrN, strNi, strNf, sizeN, n, diag(3), a,b,c,d,e,f, nType
  +integer HNF(3,3), L(3,3), hnf_degen, lab_degen, tot_degen, cSpec
   integer, pointer :: gIndx(:)
  -real(dp) :: p(3,3), sLV(3,3), eps, v(3), Ainv(3,3), sLVinv(3,3)
  +real(dp) :: p(3,3), sLV(3,3), eps, v(3), Ainv(3,3), sLVinv(3,3), shift(3)
   real(dp), pointer :: aBas(:,:), dvec(:,:) ! pointer so it can be passed in to a routine
  +integer, pointer :: nSpecType(:) 
   character(1) bulksurf
  -character(40) dummy 
  +character(80) dummy, specAtoms 
   integer, pointer :: spin(:) ! Occupation variable of the positions
   real(dp), pointer :: x(:) ! Concentration of each component
  +logical :: file_exists
   
   open(13,file="readcheck_makestr.out")
   write(13,'(5(/),"This file echoes the input for the makestr.x program and")')
  
positive.code: else
    strNf=strNi
  endif
  
  !call read_nth_line_from_enumlist()
  open(11,file=fname,status='old',iostat=ioerr)
  
negative.code:       write(13,'(i3," atoms of label type ",i2," found")') ic, i
     enddo
     write(13,'("Finished counting the atoms of each type")')  
     ! Write the number of spectator atoms on line 6 of the poscar
     if (file_exists) write(12,'(100(i4,1x))') nSpecType*n !
     !write(12,*) ! Start next line
     write(12,'("D")')
     
     ! This part lists the atomic basis vectors that we found in the triple z1, z2, z3 loops above.
     ! For vasp, UNCLE it needs to list the vectors in blocks of atoms that have the same label.
     call cartesian2direct(sLV,aBas,eps)
     do ilab = 0,k-1
        do iAt = 1, n*nD
  