Added Doc, references

Needed to clean up the code a bit, so added documentation, and a bit of
formatting.
Merge pull request #2 from lewisNotestine/bugfix_codeCleanup

Added Doc, references