anchor.diff:  !!----------------------------------------------------------------------------!!
   
         integer, parameter :: dim = 6
  -      integer :: min, max
  +      integer :: min, max, i
         real*8, dimension(2, dim)  :: pos
         real*8, dimension(dim)     :: value
         real*8  :: x, y, alpha, beta, gamma
   
         interface
             subroutine findval(pos, value, dim)
  -          real*8, intent(in), dimension(:,:) :: pos
  -          real*8, intent(out), dimension(:)  :: value
  -          integer, intent(in)                :: dim
  +              real*8, dimension(:,:) :: pos
  +              real*8, dimension(:)   :: value
  +              integer                :: dim
             end subroutine findval
         end interface
   
  +      interface
  +          subroutine populate(pos, dim)
  +              real*8, dimension(:,:) :: pos
  +              integer                :: dim
  +          end subroutine populate
  +      end interface
  +
  +      interface
  +          subroutine minmax(value, min, max)
  +              real*8, intent(in)   :: value(:)
  +              integer, intent(out) :: min, max
  +          end subroutine minmax
  +      end interface
  +
  +      interface
  +          subroutine centroid(pos, min, max, dim)
  +              real*8, intent(inout)  :: pos(:,:)
  +              integer, intent(in)    :: min, max, dim
  +          end subroutine centroid
  +      end interface
  +
  +      call populate(pos, dim)
  +
         call findval(pos, value, dim)
  -      write(*,*) value
  +
  +      call minmax(value, min, max)
  +      do i = 1,dim
  +          write(*,*) value(i), pos(1, i), pos(2,i)
  +      end do
  +      write(*,*) max, min
  +
  +      call centroid(pos, min, max, dim)
  +      write(*,*) pos(1, 4), pos(2, 4)
   
   end program
   
  
positive.code:           call random_number(pos(1,i))
            call random_number(pos(2,i))
        end do
  
        
  end subroutine
  
  !! finds centroid position
  pure subroutine centroid(pos, min, max, dim)
        implicit none
        real*8, intent(inout)  :: pos(:,:)
  
negative.code: ! Purpose: To implement a simple optimization scheme in Fortran!
  !
  !   Notes: the value array has 3 accessory elements for different things:
  !              1. Centroid position
  !              2. Contraction / Expansion
  !              3. Reflection
  !
  !!----------------------------------------------------------------------------!!
  
  