tcp implementation of our 512 project