A measure to reform the Medicare physician payment system and extend the Children’s Health Insurance Program passed the U.S. Senate almost unanimously.

Sens. Joe Manchin and Shelley Moore Capito both voted in favor of the Medicare Access and Children’s Health Insurance Program Reauthorization Act of 2015. The legislation permanently replaces the Medicare Sustainable Growth Rate Formula and ensure seniors in need of outpatient rehabilitation services have access to affordable care. It also funds the children’s insurance program and the Secure Rural Schools Program for another two years. Community health centers also will see funding.

The Medicare formula had been patched 17 times over the past 13 years, costing nearly $170 billion, according to Manchin, a Democrat.

“I am pleased Congress passed legislation to fix a flawed system by reforming the Medicare formula for paying doctors who see Medicare patients,” he said. “In addition, this legislation will help move us away from a Medicare system based on the quantity of patients seen and number of tests ordered toward a system that will reward doctors for the quality of care patients receive.”

That change, Manchin said, will reduce wait times for seniors and provide stability in the health care system.

“Without this SRG fix, physician reimbursements from the Medicare program would drop significantly, impacting the ability of physicians to accept Medicare patients and limiting senior citizens’ access to their doctors,” Capito said.

Capito, a Republican, credited her party’s leadership in getting the bill passed, and said it is just a first step in reforming expensive entitlement programs.

“The new Republican-led Congress is back to work, finding solutions to move our country forward,” she said. “I am pleased that the Senate followed the House to pass this bipartisan bill and take an important step toward broader entitlement reform.”