Added comments for explanation

Is this too pedantic? I figured that for people with no experience it's probably better to have lots of comments in our code.

I also used the `pep8` and `pyflakes` command line tools to check for style. Super useful tools! Since we're starting to put code up, it should be high quality.

Thoughts on code and comment style welcome!