added docstring to the function