Tweaking demo code