anchor.diff:        &xbob(i),ybob(i),xpbob(i),ypbob(i)                                  !hr08
       end do
   
  -    write(amplitude2_unit,*)'# 1=ielem 2=name 3=s 4=ORBITX 5=orbity 6=tdispx 7=tdispy 8=xbob 9=ybob 10=xpbob 11=ypbob'
  +    write(amplitude2_unit,"(a)") "# 1=ielem 2=name 3=s 4=ORBITX 5=orbity 6=tdispx 7=tdispy 8=xbob 9=ybob 10=xpbob 11=ypbob"
   
       do i=1,iu
         write(amplitude2_unit,'(i4, (1x,a16), 9(1x,e15.7))') i, ename(i), sampl(i), torbx(i), torby(i), tdispx(i), tdispy(i), &
               xbob(i), ybob(i), xpbob(i), ypbob(i)
       end do
   
  -    write(betafunctions_unit,*) '# 1=ielem 2=name       3=s             4=TBETAX(m)     5=TBETAY(m)     6=TORBX(mm)', &
  -                '    7=TORBY(mm) 8=TORBXP(mrad)   9=TORBYP(mrad)  10=TDISPX(m)  11=MUX()    12=MUY()'
  +    write(betafunctions_unit,"(a)") "# 1=ielem 2=name       3=s             4=TBETAX(m)     5=TBETAY(m)     6=TORBX(mm)"// &
  +      "    7=TORBY(mm) 8=TORBXP(mrad)   9=TORBYP(mrad)  10=TDISPX(m)  11=MUX()    12=MUY()"
   
   
       do i=1,iu
   !     RB: added printout of closed orbit and angle
         write(betafunctions_unit,'(i5, (1x,a16), 10(1x,e15.7))') i, ename(i), sampl(i), tbetax(i), tbetay(i), torbx(i), torby(i), &
  - &    torbxp(i), torbyp(i), tdispx(i), mux(i), muy(i)
  +        torbxp(i), torbyp(i), tdispx(i), mux(i), muy(i)
       end do
     endif
   
  
positive.code:   return
  end function ran_gauss
  
  subroutine collimation_comnul
    use parpro
    implicit none
  
negative.code:   use mod_units
  !  use mod_ranecu
    use mod_ranlux
  
  #ifdef HDF5
    use hdf5_output
  