added docstring and part of documentation