Code Comments

* Commented code and slight re-organization for better readability.
* Changed tabs to spaces for consistency across editors
* Minor variable name changes to be more mnemonic

Let me know of your suggestions and opinions.