Added polling demo code.