debugged code for the two client classes