Implemented the majority of the Client and Server