added data threshold function
added data threshold function