Fix example code bugs, clarify comments.

The example code had a few bugs that I fixed, I added syntax highlighting and added/clarified some comments.