made some changes to tcp sockets and other issues with packet generation