Threshold comparison fixed