Update code for better compliance with PEP8
Use argparse module to parse command line arguments