add comments, and fix a bug I found while doing so