Completed the demo code.