client.cpp done almost