Added output parameter showing computed threshold
Moved breathing mask removal to its own section