code review

Hey guys, here's a pull request.

I left comments inline, so look at the commit's diff to see them in context.