Rewrote network code to be single threaded