Prettying it up

Added some comments to better explain how things work.
Prettying it up #2

Fixing up some whitespace and fixing a couple errors I made by accident.