Added comments throughout the file and a couple TODOs. Tried to add docstrings where I could.