added docstrings for the functions :relieved:
added docstrings, renamed some variables, fixed typos :neckbeard: