#4, #10: Added a lot of docstrings and some small refactorings of comments.