- & 'SSBOND',i,'CYS',ihpb(i)-1-nres,
- & 'CYS',jhpb(i)-1-nres
+ & 'SSBOND',i,'CYS',idssb(i)-nnt+1,
+ & 'CYS',jdssb(i)-nnt+1
+ else
+ write(iunit,'(a6,i4,1x,a3,i7,4x,a3,i7)')
+ & 'SSBOND',i,'CYS',ihpb(i)-nnt+1-nres,
+ & 'CYS',jhpb(i)-nnt+1-nres
+ endif