rm demo code