revised version of demo1.0