sending/receiving data placed in loop