anchor.diff:      ! 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
  +    ! TODO: fix this, the samples are shift, remove from output and use single block to test. 
       real*8, intent(out), dimension(nd) :: close
       integer, intent(out) :: nclose, infoct, na
       real*8, intent(out), dimension(ndmax)  ::  xa,ya,za,vra, vea
  +    ! TODO: add here variables with estimate
       
     
       ! internal 
  
positive.code:         ! ' enough data for OK or SK.   KT3D currently leaves ',/, &
          ! ' these locations unestimated.',/, &
          ! ' This message is only written once - the first time.',/)
      
          ! There are enough samples - proceed with estimation.
          
  
negative.code:             resce  = covmax / max(extest,0.0001)
          endif
          
          
          ! FROM AAAAAAA  Put this in a separate function to isolate and add more options (use kdtree for speed, see example scipy)
          ! ----------------------------------------------------------------------------------------------------------------        
          
          ! Find the nearest samples:
      
          call srchsupr(xloc,yloc,zloc,radsqd,isrot,MAXROT,rotmat,nsbtosr, &
  