- added a bunch of comments
- cleaned up a bit of code