Working version with command-line parameters