create a function to select the threshold for small change