Updated the demo code and clarified missing parts.