Adding docstrings, fixing small bugs, etc