add function docstring
updated bash script