Test and demo code