added protected server to ns file, and wrote function for the server. It compiles when transplanted to server.cpp, but needs its own make rule