Minor commenting changes

I put a comment at the beginning of each function to describe what it
is doing, and made the spacing more uniform.
Merge pull request #6 from lithiah/master

Minor commenting changes