Small change to make the example work better.
More fixes and comments.