Even though they control the White House and both houses of Congress, Republicans have struggled to pass meaningful legislation, and might not even be able to keep the government open after tonight. These struggles, combined with the awarding of the congressional gold medal to former Senate majority leader Bob Dole (R-Kan.) this week, has left many wistful for the productive years of divided government in the 1990s.

Back then, despite two government shutdowns and contentious public squabbles, leaders of both parties worked together to pass two major pieces of legislation, welfare reform and a balanced budget, as well as an increased minimum wage. They were also laying the groundwork for a bold initiative that would be unthinkable today — an overhaul of Social Security. Critics continue to debate whether the legislation was good for the country, but the process behind its passage revealed how the system is supposed to work.

Why was divided government more effective in the 1990s then one-party control today?

Beginning in 1995, a relative balance of power required bipartisanship. Democrats controlled the White House; Republicans exercised control of the Senate and the House. Moderates who wanted to make deals still outnumbered ideologues who wanted to wage partisan warfare.

The key difference between then and now, however, is that there were two leaders who possessed personal chemistry, were willing to break with their respective bases and possessed a desire to leave a legislative legacy.

Despite all their political differences and their highly charged public battles, President Bill Clinton and House Speaker Newt Gingrich managed to work behind the scenes to make government work.

While they lashed out at each other in public, the two men, who came from similar backgrounds, had an easy private rapport — not unlike political odd couples of years past like Everett Dirksen and Lyndon Johnson in the 1960s and Tip O’Neill and Ronald Reagan in the 1980s. The relationship often puzzled those around them but was essential for deal-making. Democratic leaders were so worried that Clinton would make deals with Gingrich that they tried to intercept the speaker’s phone calls and often recruited Vice President Al Gore to keep the president from giving away too much. The same was true of Gingrich. House leaders insisted that House Majority Leader Dick Armey chaperon Gingrich to all his meetings with the president.

On specific public policy issues, Clinton and Gingrich were never as far apart as their rhetoric suggested. Both were ideas men who challenged the traditional politics of their parties and called for a “third way” — a new approach to thinking about problems that challenged the conventional liberal and conservative notions. Gingrich was frustrated with Republican politics in Congress and pushed his party to adopt new ideas. Clinton was eager to distance himself from the liberal excesses of his party’s recent past while keeping alive the tradition of activist government.

By 1996 both men had also been chastened by political reality.

Gingrich spearheaded the Republican takeover of Congress in 1994 but quickly discovered the difference between mobilizing opposition and leading a majority. Bruised from the public backlash following two government shutdowns, Gingrich realized that Americans embraced the rhetoric of change but not its consequences.

Clinton had experienced a similar sting after he overreached in his first two years, trying to push through an overly ambitious agenda that cost Democrats control of Congress. In the wake of the Republican triumph in 1994, Clinton was even forced to assert his continued relevance.

After 1995, the president distanced himself from the liberal base of his own party and searched for ways to build a coalition among moderates in both parties.

By the following year, with Clinton cruising toward reelection and a wounded but still strong Gingrich maintaining firm control of the House, the time seemed ripe for dealmaking.

A desire to leave a legislative mark also drove both men.

Gingrich, who possessed a grandiose sense of his own historical significance, wanted to be remembered as more than a conservative rebel. He was a revolutionary who longed to be a statesman, a populist who desperately needed the respect of the establishment. Clinton, fearing that he would be remembered as a “third-tier president,” wished to emulate Thomas Jefferson and Theodore Roosevelt, two predecessors who ushered in new centuries by redefining the role of government.

Both men seized the opportunity.

In 1996, they passed the most sweeping overhaul of federal welfare policy since the New Deal. Building on the momentum of that success, they negotiated a historic balanced budget agreement that allowed both men to declare victory. Gingrich could trumpet forcing Clinton to accept the idea of a balanced budget, while Clinton could champion the creation of a new entitlement — the State Children’s Health Insurance Program, which provided health care for children who did not qualify for Medicaid.

Clinton and Gingrich reaped public praise for their success but angered their respective bases. Gingrich, who taught Republicans how to gain power by polarizing, now was trying to teach them to exercise it by compromising. It was a hard lesson for his troops. Similarly, House Democrats, many of whom voted against both bills, resented how the president “triangulated,” using them as foils.

Undeterred, the two men quietly found common ground on the most contentious issue in American politics: Social Security. Clinton agreed to partly privatize Social Security in exchange for Gingrich dropping his incessant demands for a tax cut. In a secret meeting in the White House Treaty Room, Clinton and Gingrich arranged to forge a centrist coalition made up of moderate Democrats and Republicans to support the initiative, which Clinton would announce as part of his 1998 State of the Union address. Gingrich would follow with a statement endorsing the president’s reform effort.

The nation never had the opportunity to debate the proposal.

One week before Clinton’s speech, The Washington Post revealed that the president was having an illicit affair with an unnamed intern. The Monica Lewinsky scandal ended the Clinton/Gingrich partnership. Clinton now needed the most liberal members of his party — the ones he had largely abandoned over the previous four years — to save his presidency. At the same time, House conservatives, frustrated with Gingrich’s efforts to strike deals with a man they considered to be the devil, clipped his wings and plotted his overthrow.

Despite all their backroom dealings and their commitment to governance, both men bear some responsibility for the poisonous partisanship that characterizes our politics today. Clinton’s reckless personal behavior ended up empowering the most ideological members in his party.

Much of the burden, however, falls on Gingrich, who mistakenly believed that he could employ scorched earth tactics and shrill partisan rhetoric while at the same time serving as a statesman who cut bipartisan deals. He failed to realize that his tactics and language shaped an entire generation of Republican leaders who were more interested in combat then in compromise.

Partly because of this miscalculation, none of the conditions that allowed bipartisanship to flourish in the 1990s exist today.

Although they represented different parties, Clinton and Gingrich had far more in common than the strait-laced, policy-wonk, classic conservative Paul Ryan and the flamboyant and largely uninformed, nonideological populist president. There is no leader on the horizon in either party who appears willing to challenge the status quo, buck his or her own party and reach across the aisle. Even President Trump — in many ways less beholden to his party than any president in any recent times — seems afraid of crossing his base.

Most of all, although their numbers had already started to dwindle, in the 1990s there were still moderates in both parties who were eager to govern. That is no longer true. Over the past two decades the middle ground has been hollowed out of American politics. Resources flow to candidates who embrace party orthodoxy.

The media landscape has ossified into hardcore ideological camps. The problem has been especially acute for the Republican Party, which has lurched so far to the right that it operates more like a religious cult then a political party. Today, any legislator, especially on the Republican side, who dares even speak of compromise will incur the wrath of right-wing “news” outlets and find themselves the target of powerful and well-funded special interests.

Most find it easier to accept the party line than face a primary opponent. The same forces compel those in power to use procedural tactics to obstruct the opposition and prevent compromise. The result is a politics of gridlock and dysfunction.

Who would have thought that we would view the 1990s as the “good ole days” of bipartisan government?