Added docstrings, beautified this and that.