      subroutine cbsu3_bstaple2(my_id,ilat0,idl,isl,staple,bstaple) 
C Bernd Berg Jun 20 2008.
c idl, isl -- link coords.
      include '../../Libs/Fortran/implicit.sta'
      include 'mpif.h'
      include '../../Libs/Fortran/constants.par'
      include '../../Libs/Fortran_par/latmpi.par' ! Defines n18
      include '../../Libs/Fortran_par/mc.par'
      include '../../Libs/MPI_par/common_cblat.f'
      include '../../Libs/MPISU3/common_cbsu3.f' 
      include '../../Libs/MPISU3/common_2cbsu3.f' 
      dimension staple(n18),bstaple(n18),r1(n18),r2(n18)
      ltest=.true.
      ltest=.false.
      if(ltest) print*,"my_id =",my_id
C
      call su3init0(staple)  ! Initialize matrix to 0.
      call su3init0(bstaple) ! Initialize matrix to 0.
      do idp=1,nd
        if(idp.ne.idl) then
c building staple on forward plq:
          call su3mult_m_mh_m(a1su3(1,ipf2(idl,isl),idp),
     &                        a1su3(1,ipf2(idp,isl),idl),r1)
          call su3mult_m_mh_m(r1,a2su3(1,isl,idp),r2)
          ilat=ilat0+iba1(ipf2(idl,isl),idp)+iba1(ipf2(idp,isl),idl)
     &        +iba2(isl,idp)  
          call su3add_m_m(staple,r2)            ! add staple.
          call su3addb_m_m(bstaple,r2,ba(ilat)) ! add beta*staple.
c building staple on backward plq:
          ii=ipb2(idp,isl)
          call su3mult_mh_mh_m(a2su3(1,ipf1(idl,ii),idp),
     &                         a1su3(1,ii,idl),r1)
          call su3mult_m_m_m(r1,a1su3(1,ii,idp),r2)
          ilat=ilat0+iba2(ipf1(idl,ii),idp)+iba1(ii,idl)+iba1(ii,idp)
          call su3add_m_m(staple,r2)            ! add staple.
          call su3addb_m_m(bstaple,r2,ba(ilat)) ! add beta*staple.
        endif
      enddo
C
      return
      end
