demo code updated