Improved TCP implementation