Improved demo code.