cleaned up client.c