scan1.threshold added (and corrected)