Started to code the communication thread