updated core functionality and comments.
Improved code flow.
Merge pull request #2 from bkford/master

Updated core functionality and comments, improved code flow.