updated to use a command line flag