modify the demo with new method