anchor.diff:          ! ' enough data for OK or SK.   KT3D currently leaves ',/, &
           ! ' these locations unestimated.',/, &
           ! ' This message is only written once - the first time.',/)
  +    
  +    
  +        ! To AAAAAAA -> Put this in a separate function to isolate and add more options (use kdtree for speed, see example scipy)
  +        ! ----------------------------------------------------------------------------------------------------------------
  +    
  +    
       
           ! There are enough samples - proceed with estimation.
           
  
positive.code:     ! drift
      real*8, intent(out) ::  bv(9)
      ! the samples around the block (last block) we may use this to test estimate in a single block
      real*8, intent(out), dimension(nd) :: close
      integer, intent(out) :: nclose, infoct, na
      real*8, intent(out), dimension(ndmax)  ::  xa,ya,za,vra, vea
      
    
      ! internal 
  
negative.code:     !-----------------------------------------------------------------------
  
  
      ! TODO: simplify this function as mush as possible
      !      - split search in to external function (use kdtree for speed)
      !      - remove unnecessary variables output an options  
      !      - store the debugging info in the last estimate (to test use a single block estimate)
      
      ! TODO: consider rewriting this as a single block estimate and iterate in Python 
      !       use Cython, Numba and parallel computing as way to speed the process 
  
      !for safety reason we don't want undeclared variables
      IMPLICIT NONE 
  
  