Cleaned up code + comments

- Cleaned up the code to fit the 80-character-per-line standard.
- Added more comments