Added docstrings, cleaned up code, and fixed a few bugs throughout the project.