CALIFORNIA has changed direction this year. This is not because of a conservative backlash in the mid-term elections, for there wasn't one—California bucked the national trend and elected Democrats to all eight of its statewide offices. The legislature remains solidly Democratic. Even the new governor who takes office next month is in fact an old one: Jerry Brown last had the job in 1975-83.

Instead, the change of direction is constitutional, and comes as the cumulative result of a number of decisions that voters made this year, through the state's peculiar brand of “direct democracy”. In the three decades since Mr Brown's last reign, voters had created, through the cumulative effect of ballot initiatives, a Byzantine system of governance, taxation and budgeting that left California helpless when the Great Recession hit. In the course of 2010 they have passed reforms that could make the system work again. It will, however, take time.

In the near term, things may get worse before they get better. Unemployment, at 12.4%, remains higher than in any state except Nevada (wrecked by a property crash) and Michigan (devastated by the downsizing of the car industry). A lot of houses are still in foreclosure. Tax revenues remain far below their pre-recession levels though October was a strong month.

A state budget was finally signed in October after a record delay of 100 days, but it was based on silly projections and gimmicks. Mac Taylor, the legislature's independent analyst, estimates that the budget remains $25.4 billion, or about 29% of spending, in deficit for this and the next fiscal year, with annual deficits of about $20 billion thereafter until 2016. State spending—on welfare, education and much else—has already been cut by about $16 billion in three years, and must be cut more.

This is the mess that Mr Brown is about to inherit. He takes office on January 3rd and must present a balanced budget to the legislature just one week later. And Mr Brown knows better than anybody else how hard that will be.

It was he, as governor in 1978, who had to implement (having opposed it) Proposition 13, the most infamous of all ballot initiatives. Created by an anti-tax, small-government insurgency that foreshadowed the “tea-party” movement, “Prop 13” cut property taxes, capped their subsequent rise and required two-thirds majorities in the legislature to raise any tax at all. It thereby undercut the main funding source of local governments, especially school districts. Before it, school districts collected and spent their own revenues. Ever since, they have had to rely for much of their funding on Sacramento, the state capital.

In the following decades, voters kept tightening the fiscal straitjacket with more “ballot-box budgeting”. Loving education but hating taxes, they mandated lots more spending on schools, the largest bit of the budget. Enraged about the latest grisly crime, the voters repeatedly mandated tougher sentencing. This led to a surge in prison spending and overcrowding so inhumane that in 2009 a panel of federal judges ordered the state to release or transfer some 40,000 of its roughly 164,000 inmates. The Supreme Court this week heard arguments in California's appeal. From fast trains to stem-cell research, Californians voted for good things while neglecting to pay for them.

All this has meant that legislators have been left with ever less discretion over their budgets. But they were irresponsible in wielding even that, for California's system assures gridlock. Another voter initiative has, since the 1930s, required two-thirds majorities in the legislature to pass a budget. Democrats fall just short of that, so Republicans have been able to block deals.

The underlying malaise was partisan extremism. Republicans and Democrats in California have long lived on different planets. They ran for office in artificially drawn districts that were reliably Democratic or Republican. They therefore competed mainly in the primaries, as opposed to the general election, against rivals in their own party. Both Democrats and Republicans played to their respective bases, making compromise even harder.

The case for optimism starts right there. Californians this year voted for reforms that should make their politics more moderate and the legislature, as a result, more effective. The hope is that if representative democracy improves, direct democracy may become less frantic too.

One reform takes the power to draw the districts of state legislators and congressmen away from those legislators and gives it to an independent redistricting commission, which first met this week. Next summer, using the new census numbers, the 14 commissioners will redraw the state's electoral boundaries to make districts more geographically coherent and ethnically and politically diverse. Politicians will then no longer be able to choose their voters, but will have to appeal to a broad cross-section of them.

Voters have also adopted an open-primary system, imported from Washington state. Whether Republican, Democratic or independent, all voters will henceforth be able to choose any candidate from any party in the primary; the top two candidates will then face each other in the general election even if they are from the same party. Throughout their campaigns politicians must therefore speak to the whole electorate, not only their base. To make the legislature's main task—passing a budget—easier, voters also lowered the required margin to a simple majority. Many of the interlocking elements of California's dysfunction have thus been dealt with.

Moreover, a consensus has emerged about the reforms still needed: longer term limits for legislators; a simpler, broader and less volatile tax system; and so forth. Proposals for all this already exist. Mr Brown has even hinted that he wants to undo the most insidious aspect of Proposition 13 and return to local governments the power to raise revenues. He would certainly seem ideally qualified to do so.