      integer*4 baton
      baton = 0
      do i=0, nnodes()-2
        if(nodeid() .eq. i) 
          print*, 'hello from', nodeid(), baton
          baton = baton + 1  
          call snd(i, baton, 4, i+1, 1)
        else if(nodeid() .eq. i+1) 
          call rcv(i, baton, 4, i, 1)
        endif
      enddo
      if (nodeid() .eq. nnodes()-1) 
         print*, 'hello from', nodeid()
      endif  
