Rewrote client and server to use network layer functions