abstract functions out

abstracted some functions out to clarify how the process is working,
added more concise documentation to the functions
Merge pull request #10 from zachmokahn/update_documentation

abstract functions out