After weeks of bickering over competing versions of a bill to reform the embattled Department of Veterans Affairs, a compromise has been reached between the House and Senate veterans affairs committees — just days before the August recess.

The $17 billion dollar bill — $5 billion of which is offset by cuts elsewhere in the VA — functions as a stop-gap fix to the troubled agency, which has faced an avalanche of criticism in recent months over long wait times and alleged data tampering.

The key issue was the cost of the bill and how it would be paid for. During the conference, VA Committee Chairman Sen. Bernie Sanders, and Independent from Vermont said, “Funding for veterans’ needs must be considered a cost of war and appropriated as emergency spending. Planes and tanks and guns are a cost of war. So is taking care of the men and women who fight our battles.”

The Veterans’ Access to Care Act includes $10 billion for veterans to seek outside care if wait times for an appointment are excessive, or if they live more than 40 miles from a VA facility. The outside care includes Medicare providers, Department of Defense facilities, and the Indian Health Service.

It also includes nearly $2 billion for 27 new facilities across the country, as well as $5 billion to immediately begin hiring more doctors and nurses.

One of the key provisions is a rapidly expedited process for terminating employees. Under federal employee rules, firing a VA worker often took months, or even years, due to lengthy appeals processes. Now an employee can be immediately suspended or terminated without pay, with a week to appeal and a result within 21 days.

The bill will also establish an independent commission to study VA care access and provision, and recommend ways to end the multibillion dollar backlog in facilities’ construction and maintenance.

Some other changes not directly linked to the recent scandals have also been addressed. Recipients of the Post-9/11 GI Bill will now qualify for in-state tuition rates at any public university in the country, regardless of residency requirements. It also reforms delivery of care to sexual assault victims and expands the John David Fry Scholarship program for spouses of military members who died in the line of duty.

There had been serious doubt the bill was going to get past Congress. “I think most Americans understand that Congress is basically dysfunctional. Almost no major legislation is being passed. Despite the many differences between the House and the Senate, we finally have reached agreement,” Sanders said.

It isn't out of the woods yet, though House VA Committee Chairman Jeff Miller said, “We expect it to clear conference tonight.” Both Miller and Sanders expressed confidence it would pass, and that the vote would take place before the summer recess, which kicks off and the end of this week.

The nominee for VA Secretary, Bob McDonald, is expected to be confirmed later this week. This bill will provide him with at least some of the resources he will need to fix the VA.

But the long road to VA reform does not end with a new name at the helm or a simple piece of legislation, leaders said.

“This is not the end, this is the beginning,” Sanders warned.

Stephen Carlson served two tours in Afghanistan as an infantryman with the 10th Mountain Division. He lives in Washington, D.C. Follow him on Twitter.