Added docstrings and cleaned up a few variable names that were confusing
due to pre-refactor context