+ if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
+C changes suggested by Ana to avoid out of bounds
+C & .or.((i+5).gt.nres)
+C & .or.((i-1).le.0)
+C end of changes suggested by Ana
+ & .or. itype(i+2).eq.ntyp1
+ & .or. itype(i+3).eq.ntyp1
+C & .or. itype(i+5).eq.ntyp1
+C & .or. itype(i).eq.ntyp1
+C & .or. itype(i-1).eq.ntyp1
+ & ) goto 178
+