working event loop and 2 way communication