Added code for TCP set up