created demo.py and solved a few errors