changed demo code