Updated docstrings and comments