idem for compute_threshold