function: added some comments and docstrings