minor changes to the demo code