example.py made more flexible