Improved script in line with PEP8, and changed command-line input interpretation to use argparse