Minor tweaks and make the code a bit more flexible by allowing it to tak

...e arguments from command line.