now threshold can be specified in the argument.