version of server.cpp to merge to master