Add docstrings and clean stuff up.