modified example.py to work on JD's Mac