Refactored the script to shift all the moving parts to command line arguments ..