Removed references to the threshold variable