added threshold parameter to DIG
added method for finding a threshold that yields good results for a given dataset