Modified demo code.