- Added some comments.
- Minor variable renaming.