Script Works

Updated script to function properly with given options.