working version of demo1.py
(#6)