Changed the script to a class structure to make it usable from another script. Still works with command-line argument, as before.