anchor.diff:         info%psp_j(i)=M_ZERO!not needed for non spin polarised 
          enddo
   
  +!set the potential
          allocate(info%psp_v(ndmx,4))
   
          do lam=1,4
            do n=1,ndmx
  -!           !info%psp_v(n,lam)= (vnl(n,lam,1)+m%r(n)*0.5*vpsloc(n))
  -            info%psp_v(n,lam)= (vnl(n,lam,1)+0.5*vpsloc(n))
  +           info%psp_v(n,lam)= (vnl(n,lam,1)/m%r(n)+vpsloc(n))
  +           !info%psp_v(n,lam)= (vnl(n,lam,1)+0.5*vpsloc(n))
  +           !info%psp_v(n,lam)= (vnl(n,lam,1)+vpsloc(n))
  +           !info%psp_v(n,lam)= (vnl(n,lam,1))
  +           !info%psp_v(n,lam)= -2*zval+vnl(n,lam,1)
  +           !info%psp_v(n,lam)= -2*zval
            enddo
          enddo
  +
  +       !get jcut mesh index. this is the point where we should just cut off the calculated potential values 
  +       do lam=1,4
  +         do n=1,ndmx
  +           if (abs(info%psp_v(n,lam)+2*zval/m%r(n)) .gt. 1.d-3) then
  +           !if (abs(info%psp_v(n,lam)) .gt. 1.d-3) then
  +             jcut=n
  +           endif
  +         enddo
  +       !put jcut in the middle of the mesh
  +       jcut=1
  +
  +       !smooth the curve
  +         !do n=jcut,ndmx
  +         do n=1,ndmx
  +           !info%psp_v(n,lam)=-2*zval/m%r(n)+cutoff_function(m%r(n)-m%r(jcut))*(vnl(n,lam,1)/m%r(n)+vpsloc(n)+2*zval/m%r(n))
  +           !info%psp_v(n,lam)=-2*zval+cutoff_function(m%r(n)-m%r(jcut))*(info%psp_v(n,lam))
  +         enddo
  +       enddo!end the lam loop
  +
    
          do n=1,nwfsx !set the number of pseudo wavefunctions
            if (ocs(n) .ne. 0) then
  
positive.code: 
          !my siesta title thing
          !do i=info%n_wfs-nwfts+1, info%n_wfs
          l=1
          do i=info%n_wfs-info%n_pwfs+1, info%n_wfs
            if (info%wfs_occ(i, 1) .le. 0) then
  
negative.code:          end if
         enddo
  
         do l=1,nwfsx!define the proper cutoff values of the wfs
           do n=1,grid_in%mesh
             if ( info%m%r(n) .lt. rcut(l) ) then
               info%wfs_rc(l) = info%m%r(n)
             endif
           enddo
         enddo
  
        endsubroutine ps_io_type_fill
  
        subroutine ps_io_save(info)!this seems only necessary to setup the filename and assign io units
  