Moved from ugly sys.argv to the much nicer argparse module; Slight comment rewriting