finish demo code