A method and apparatus for treating a breathing disorder and, more particularly, a method and apparatus for providing a pressurized air flow to an airway of a patient to treat congestive heart failure in combination with Cheyne-Stokes respiration and/or sleep apnea or other breathing disorders. A positive airway pressure ventilator is utilized in combination with an algorithm that adjusts IPAP and EPAP in order to counter a Cheyne-Stokes breathing pattern. Cheyne-Stokes respiration is detected by monitoring a peak flow of the patient.