branch tim revised client.c