made demo code work for exercise