added function docstring