Set threshold as a passable parameter.