working demo code