update doc and demo code