implement client-writer functionality