added the threshold option as an int passed in the shell as argv3