added a missing calc_thresh.m