Cleaned up the example.py a bit and added some comments.