Optimized slow parts of project 2, began work on TCP