anchor.diff:          WRITE(6,"(I5,E11.4)") IT, EIG(K)
   
           IF (ABS((EIG(K) - EA) / EIG(K)) .GE. EPS) THEN
  -            EA=EIG(K)
  +            EA = EIG(K)
  +        ELSE
               EXIT
           END IF
   
  -        IF (IT .EQ. NMAX) WRITE(9,"(A)") " MAXIMUM OF ITERATIONS REACHED"
  +        IF (IT .EQ. NMAX) THEN
  +            WRITE(9,"(A)") " MAXIMUM OF ITERATIONS REACHED"
  +            EXIT
  +        END IF
  +
  +        IT = IT + 1
   
       END DO
  +
   
   END DO
   
  
positive.code: WRITE(6,*) " KIRKWOOD"
  WRITE(6,*)
  WRITE(6,"(A,F9.4,E12.4)") " FRICTIONAL COEFFICIENT = ", F1, FR1
  WRITE(6,*) " BLOOMFIELD "
  WRITE(6,*)
  WRITE(6,"(A,F9.4,E12.4)") " FRICTIONAL COEFFICIENT = ", F2, FR2
  WRITE(6,"(A, I5)") " TOTAL SPHERES = ", NATOM
  
  ! ITERATIONS START HERE
  
  DO I = 1, NATOM
      DO J = 1, NATOM
          IF (I .NE. J) THEN
              DO K = 1, IP
                  T(I,J,K) = T(I,J,K) * E(J)
  
negative.code:     E3 = E2 * E(K)
      S4 = S4 + E3
  
      DO L = 1, NSPHERE
          EL2 = E(L)**2
          IF (K .LT. L) THEN
              D2 = 0.0
  