added docstrings and an (incomplete) argument parser
factored out parsing into another modle