update docstring and comments