Added docstrings and command line parameters