Ported from previous work
Added docstrings and simplified globals file
Fixed module docstring
Continuing docstring docstring documentation, simplifying code