added a docstring to main function