Add some comments, and move a few things around