anchor.diff:    
     comb_step =  (1d0 - pt2_cweight(first_det_of_comb-1)) * comb_step
     
  -  stato = 1d0 - comb_step! + 1d-5
  +  stato = 1d0 - comb_step
  +  iloc = N_det_generators
     do i=comb_teeth, 1, -1
  -    first_det_of_teeth(i) = pt2_find(stato, pt2_cweight, N_det_generators)
  +    integer :: iloc
  +    iloc = pt2_find(stato, pt2_cweight, N_det_generators, 0, iloc)
  +    first_det_of_teeth(i) = iloc
       stato -= comb_step
     end do
     first_det_of_teeth(comb_teeth+1) = N_det_generators + 1
  
positive.code: 
    zmq_to_qp_run_socket = new_zmq_to_qp_run_socket()
    zmq_socket_pull = new_zmq_pull_socket()
    allocate(val(b%N), det(N_int, 2, b%N), task_id(N_det), index(N_det))
    more = 1
    if (time0 < 0.d0) then
        time0 = omp_get_wtime()
  
negative.code: end subroutine
  
  
  integer function pt2_find(v, w, sze, imin, imax)
    implicit none
    integer, intent(in) :: sze, imin, imax
    double precision, intent(in) :: v, w(sze)
    integer :: i,l,h
  
    l = imin
    h = imax-1
  
    do while(h >= l)
      i = ishft(h+l,-1)
  