add ClientManager code, which is unfinished