code for demo1