Added comments to all code blocks.
OO'd the data dumping code.
Improved comments.
Give the variables meaningful names.
No functional changes: Just horizontal whitespace.