server.cpp final version