Helpful comments

I added some comments and did a little re-writing.

Let me know if something doesn't quite add up. :D