modified pseudo code for client.c