added the rest of the work for client/server