modified client.cpp