Complete demo code