Working code for Demo 2.