modify the demo code