Threshold estimation added