METAL shutters have come down, stocks of food have been run down and tatty bags with clothing for several weeks lie by the side of a road leading out of Nairobi, Kenya’s ethnically mixed capital, to farmland north-west. “We don’t want to be here for the election,” says a 15-year-old boy helping his parents lock up their tin-and-timber home. Some neighbours have already left, fearing violence after a presidential poll on March 4th and a possible run-off in April. Others never returned after more than 1,300 people died in tribal clashes and 600,000 were displaced following the last election five years ago. They settled in ethnic enclaves elsewhere, leaving behind empty shacks with calendars from 2007 still on the walls.

Back then various ethnic groups had disputed the election result and lashed out at each other until their leaders agreed on the formation of a national-unity government. Several candidates in this election are accused of orchestrating the violence five years ago and have been indicted by the International Criminal Court (ICC) in The Hague.

Will Kenya’s nightmare recur, as many fear, potentially crashing the economy and undermining the country’s standing as one of Africa’s better multiparty democracies? There are plenty of reasons to worry. For one, the race is very close. Raila Odinga (pictured above), the sitting prime minister who heads the Coalition for Reform and Democracy, is neck-and-neck in the polls with Uhuru Kenyatta, the deputy prime minister from the Jubilee alliance.

Unless one of them pulls ahead, supporters are almost certain to accuse each other of vote rigging—which might provoke a violent reaction. To attain a clear victory in the run-off, the winner will have to garner the support of the third-placed candidate, Musalia Mudavadi. He could emerge as kingmaker, but only if he is able to take his voters with him as a bloc. At the last election he supported Mr Odinga; more recently he co-operated with Mr Kenyatta but then fell out with him.

All three have campaigned along ethnic lines, polarising the electorate. The five largest tribal groups, making up almost 70% of the population, act as near-monolithic blocs at elections. Mr Kenyatta’s Kikuyu bloc is the largest (21%) and Mr Odinga’s Luo the smallest (10%), with Mr Mudavadi’s Luhya (19%) the second largest but also among the least cohesive. Kikuyus are said to practise “oathing”, in which villagers swear only to vote for candidates from their tribe.

That is especially divisive in this election. A new constitution adopted in 2010 vastly expands the number of contested positions. In addition to directly electing the president, Kenyans will simultaneously vote for 384 members of a bicameral legislature and governors and assemblymen for 47 newly created counties with real powers. Increased political competition within mixed communities multiplies the flashpoints. In addition, the regions contain sources of conflict that did not exist five years ago. These include a secessionist movement, the Mombasa Republican Council, which has called for a poll boycott. Some of its members have attacked election offices.

The threat would not be so grave if Kenya had adequate security forces. The government has promised to field 90,000 officers to protect voters but only a third will be from the police, with the rest made up of wildlife rangers, prison wardens and the like. Few of the officers have proper training in crowd control—a shortcoming that contributed to the killing five years ago. The army may be called in as a last resort, which would be a post-independence first. Most senior posts in the forces are in the hands of Kikuyu loyalists. Police report the formation of ethnic militias in recent months in anticipation of post-election fighting. Consignments of guns and machetes are said to have arrived in Nairobi slums. Talkshows on ethnic-language radio as well as text messages and Facebook are used to spread what Kenyans call “hate speech”, encouraging listeners to beat, loot, riot, kill, steal and evict opponents, whom they label maggots and vultures. Online troublemakers say “chinja, chinja”, or “butcher, butcher” in Swahili. Yet, despite its troubles, the country also has reasons to hope for something better. Hate speech, newly banned by law, is much less common than before the last election. Radio stations now broadcast with a time delay so that they can delete offensive material. The political atmosphere is generally less tense than it was five years ago. The nomination of candidates, always a focal point for violence in Kenya, was more peaceful than usual; five people are known to have died, not the usual dozens. One of the reasons is an alliance between Mr Kenyatta’s Kikuyus and the Kalenjin (13% of the population) led by William Ruto, who was Mr Kenyatta’s campaign manager in 2002 and his opponent in 2007 before becoming his running mate. Together they are known as UhuRuto. Both men have been indicted by the ICC for ordering their followers to kill each other five years ago. Their alliance is hardly a triumph for justice, but for the moment it has removed a big source of conflict. Institutional changes will also calm tempers. The two-round voting system—a novelty for Kenya—creates a cooling-off period during which ethnic groups may adjust their expectations and seek power-sharing deals. Thanks to the new constitution, the judiciary has become more independent since 2008. It is in a much better position now to declare a winner credibly and to prosecute thugs. The chief justice, Willy Mutungu, last month showed courage and determination by publicising attempts by Kikuyu gangs, known as mungiki, to intimidate judges.

Another institutional reform of recent years is the creation of the Independent Electoral and Boundaries Commission (IEBC). Its predecessor’s poor performance was one of the triggers for violence five years ago. Delays and problems with data transmission gave rise to allegations of rigging. This time, results will be posted immediately outside each polling station and the media will receive live feeds of voter data as they are transmitted to a central collation station, making the vote harder to rig. Provisional results are expected within 48 hours. A Western diplomat says, “The IEBC got the job done, surprising everyone.” It had its share of problems. The two most senior executives come from rival political camps and fell out, hobbling the organisation for months. But it managed to register 14m voters, or 69% of the electorate, which is more than expected, and it hired 120,000 staff to run polling stations.

We are watching

The single best insurance against widespread violence may be the enormous attention the election is attracting, both at home and abroad. Calls for calm have come from a series of international statesmen, including Kofi Annan, the former UN secretary-general who is acting as the African Union’s special envoy, and Barack Obama, whose father was born in Kenya. Diplomats have privately spoken to community leaders and their governments have spent $100m on technical assistance. Five separate international monitoring missions will be present. Kenyan civil society groups are adding a sixth. ELOG, which will field 30,000 monitors across the country. Other groups promote peace and pursue justice. Volunteers scan the internet for signs of incitement; many are part of Ushahidi (“witness” in Swahili), a network that was founded after the last election and co-operates with officials to prosecute offenders. In mixed slums like Kibera in Nairobi, community organisers have worked for months to ease tensions and set up mechanisms to resolve conflicts, walking the narrow streets with megaphones to educate residents. Even the business elite, in which Kikuyus play a big part, has woken up to the dangers posed by renewed election violence, which could scare away tourists and investors.

Kenya has a good chance of avoiding a national meltdown so long as the winning margin in the election is large enough. If it becomes hard to tell who has won—especially amid allegations of rigging—and the judiciary and security forces act unfairly, then trouble will loom. The more likely scenario after the first round is a series of legal challenges that will push back the run-off to May. In the meantime, sporadic acts of violence will probably erupt in a few places, as during presidential contests in 1992 and 1997.

The most likely flashpoints are spread around the country. After the last election the worst killing sprees took place in the Rift Valley in the country’s west, but ethnic displacement and the Kikuyu-Kalenjin alliance has becalmed the region. The exception is Nakuru, where Kikuyu and Kalenjin have failed to implement a local alliance.

Other flashpoints are Nairobi, where slums are ethnically mixed, though less so now than five years ago; Kenya’s north and east, especially along the Tana River valley, where tribal clashes are fuelled by a drought and an influx of arms from nearby Somalia; and the coastal region around Mombasa, where local Muslims resent the economic dominance of Christian “upcountry immigrants” who own much of the property.

Andrew Morton remarked in his 1998 biography of the former president, Daniel arap Moi, that land and tribe are the “two mighty rivers of Kenya’s political landscape”. It is much discussed in Nairobi how far the country has really changed. Ethnic clientelism certainly lives on. The two main candidates in the election are both scions of leading families. Jomo Kenyatta was Kenya’s first president and Oginga Odinga his great rival; neither of their sons could be described as either competent or charismatic.

Such men are rarely held to account. Kenya’s Truth, Justice and Reconciliation Commission set up in 2008 after the violent elections has still not published its findings. Human Rights Watch, an international watchdog, says only 14 people were convicted for the killings. Kikuyus and Kalenjin stand by their leaders regardless of the ICC indictments.

And yet successful elections this year would be a big step towards Kenya’s becoming a modern, pluralist state. The country held its first-ever presidential debate last month. The new constitution promises to create political structures that will fundamentally transform how power is allocated. Over time it could chip away at patronage networks. The big men have not gone away but voters and vested interests are less and less willing to tolerate them.