docstrings, inline comments, some cosmetics