Updated demo_basic example to be easier to read, and demonstrate various scenario.