code for demo