anchor.diff:         n2 = nres*(nres-1)/2
          allocate(p2(2,n2))
          call parse_dimers(nres,cg,n2,p2)
  -       allocate(p3(3,n2))
  -       call parse_trimers(n2,p2,n2,2,p2,p3)
  +       n3 = 1000
  +       allocate(p3(3,n3))
  +       call parse_trimers(n2,p2,n2,2,p2,n3,p3)
  +c       do i=1,n3
  +c         write(*,*) (p3(il,i),il=1,3)
  +c       end do
  +       allocate(p4(4,n4))
  +       call parse_fourmers(n2,p2,n3,3,p3,n4,p4)
  +       do i=1,n4
  +         write(*,*) (p4(il,i),il=1,4)
  +       end do
   !      == deallocate arrays ==
          deallocate(p2)
          deallocate(cg)
  
positive.code:        integer, dimension(:), allocatable :: im
         integer, dimension(:,:), allocatable :: p2
         integer, dimension(:,:), allocatable :: p3
         character*16 , dimension(:), allocatable :: ta,tr
         integer i
         integer n2
   
  c
         call smd_pdb_natoms(infile,ntot)
  
negative.code:       nb = k
        end subroutine
  
        subroutine parse_trimers(nb2,p2,nb,l,p,nx,px)
        implicit none
        integer nb2,nb,l,nx
        integer p2(2,nb2)
        integer p(l,nb)
        integer px(l+1,nx)
  c 
        integer ptmp(l+1)
        integer ptmp0(l+1)
        integer i,j
        integer k
        integer tail, head
        logical ohead, otail
        integer ic
  
        integer i2,i3,j3,ik
        integer fn_out
        logical ofound,omatch
  
        fn_out = 78
         open(fn_out,file="trimer.dat",
       $            form='formatted',status='unknown')
  
        k = 0
        do i2=1,nb2
  