Seperated and wrote the server and client code