Slight changes to error messages and refactored some code.
Added some explanation.
Merge pull request #6 from salspaugh/refactor

Refactor