added a threshold for calculating the # of sign changes