Style and docstrings. Removed unused function.