anchor.diff:  !  DEFINITIONS
   !!----------------------------------------------------------------------------!!
   
  -      integer, parameter :: dim = 6
  +      integer, parameter :: dim = 4
         integer :: min, max, i
         real*8, dimension(2, dim)  :: pos
  -      real*8, dimension(dim)     :: value
  +      real*8, dimension(dim - 1)     :: value
         real*8  :: x, y, alpha, beta, gamma
   
         call downhill
  
positive.code: 
        !!call init_random_seed()
  
        do i = 1,dim - 3
            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(:,:)
        integer, intent(in)    :: min, max, dim
        integer                :: i
  
        pos(1, dim-2) = 0
        pos(2, dim-2) = 0
  
        do i = 1,dim - 2
            if (i.NE.max) then
               pos(1, dim-2) = pos(1, dim-2) + pos(1, i)
               pos(2, dim-2) = pos(2, dim-2) + pos(2, i)
            end if
        end do
  
        pos(1, dim - 2) = pos(1, dim - 2) / real(dim - 3)
        pos(1, dim - 2) = pos(2, dim - 2) / real(dim - 3)
        
  end subroutine
  
  
negative.code:       integer, intent(in)                   :: min, dim
        real*8, intent(in)                    :: alpha
  
        pos(1,min) = (1 + alpha) * pos(1,dim) - alpha * pos(1, min)
        pos(2,min) = (1 + alpha) * pos(2,dim) - alpha * pos(2, min)
  
  end subroutine
  
  