Image copyright AFP Image caption A Nato soldier in Jalalabad takes note of a ballot box for delivery to Kabul for a complete audit of all votes

If the 2014 Afghan presidential election was a massive undertaking, the current re-examination of every vote cast is hardly less complicated.

The agreement to hold a complete audit to deal with allegations of widespread fraud requires another huge logistical effort.

The rival contenders in the 14 June run-off poll, Abdullah Abdullah and Ashraf Ghani, agreed the US-brokered deal amidst high drama, narrowly avoiding the collapse of the entire process.

What's at stake is not just the legitimacy of the election of President Hamid Karzai's successor but the credibility of Afghanistan's institutions.

The figures involved are staggering:

Almost 23.000 ballot boxes from 34 provinces are being brought together in the headquarters of the Independent Election Commission (IEC) in Kabul.

They contain around eight million ballot papers which will need to be re-checked to see if there's anything suspicious.

In the first week of the audit just a few hundred ballot boxes were re-checked - so the process could take months at a time when President Karzai is due to step down and a security deal with the US is still to be signed.

International troops and the United Nations are responsible for logging and transporting the boxes which have been stored in provincial capitals since polling day.

Image copyright Reuters Image caption Election workers used donkeys in some remote parts of Afghanistan to transport ballot boxes

Image caption Isaf has already flown over 1500 ballot boxes from Western Herat province to the capital

Remote and dangerous

Given the distances involved and the nature of the terrain much of this is being done by air.

And with some areas both remote and insecure, precision military planning is needed to get planes and helicopters safely in and out of parts of the country.

Foreign troops and Afghan forces will also be responsible for the security of ballot boxes transported by road.

The IEC says that its officials and agents of both presidential candidates will accompany each and every convoy and plane.

Once in Kabul, the ballots will be checked under the watchful eyes of international observers.

One-hundred teams of IEC inspectors working in two shifts are carrying out the audit with advisers from the UN, European Union observers and agents for both candidates present throughout.

After a slow start there is now talk of hiring more teams to speed up the process, which could take weeks.

Image copyright UN Image caption UN envoy Jan Kubis inspected the audit, saying it would enhance the credibility of the electoral process

With more than 240 personnel, the European Union Election Assessment Team is the main international observation mission involved,

Over half of the group have been trained and include diplomats from European Union members' embassies in Kabul as well as US diplomats.

More are being trained and dozens more recruited in Europe before flying in to join the process.

"The European support for this audit in Afghanistan is unprecedented in the history of EU election observation missions around the world," the EU's chief observer Thijs Berman says.

Once the process is concluded, the Independent Electoral Commission will sign off on the final results. Both candidates have agreed to abide by the commission's findings.

Fraud watch

The inspection teams are looking for evidence of fraud which both candidates acknowledge has taken place - and which Abdullah Abdullah, the candidate who is currently in second place, says has happened on an "industrial scale".

Image copyright Reuters Image caption Abdullah Abdullah's supporters have protested alleging mass fraud during the presidential run-off vote

Inspectors are looking for any evidence that ballot boxes have been tampered with.

They will then compare the two copies of the results sheets for each ballot box - one of which has been sealed inside the box after the local count on election day, and a second which was sent to the national tally centre in Kabul.

Both forms must be identical. If they're not, it suggests someone has altered the results after the votes were counted.

A key area of concern are allegations of multiple voting and ballot box stuffing.

In the second round there was a very sharp rise in turnout figures in some areas and that has set alarm bells ringing.

Mr Abdullah raised suspicions after his rival Ashraf Ghani doubled his vote in many provinces and trebled it in others.

Khost calculations

One example Mr Abdullah's team has singled out is the province of Khost, in eastern Afghanistan, where the turnout figure trebled in the second round with 97% of votes going to Ashraf Ghani.

According to the IEC, more than 400,000 people cast their votes on 14 June, out of a population of more than 556,000.

On the face of it those numbers don't seem to add up. But dig a little further and an even more complicated picture emerges.

Image caption Tight security is essential to avoid any further claims of fraud and misuse of election materials

Image caption The candidates have insisted that international troops and observers be involved in the audit every step of the way

For a start, in the presidential election people are allowed to cast their votes at any polling station across the whole country. So the number of votes cast does not necessarily correspond to the number of people living in the province.

In theory people could travel from other places to vote in safer areas.

BBC reporters in eastern Afghanistan say there were noticeably higher numbers of people turning out to vote in the second round in provinces like Khost and Paktika.

But they did not notice any significant numbers of outsiders coming into these provinces to vote.

But more importantly BBC reporters also say that serious doubts have been raised over the population figures which IEC officials are using.

They come from the Afghan Statistics Office, but their figures are based on estimates because no census has been completed in decades.

In Khost for example, data from the Ministry of Education shows that more than 280,000 children are enrolled in schools in the province.

If the number of pupils alone is this high, the total figure for the province's population is likely to significantly exceed the official statistic of 556,000.

Local officials in eastern Afghanistan told a BBC reporter that the actual population of Khost was more likely to exceed one million.

If accurate this would put a rather different perspective on the credibility of the turnout figure.

Another factor likely to have affected turnout in Khost were reports of extensive negative campaigning against Mr Abdullah.

BBC reporters in this predominantly Pashtun area say that prior to the run-off, tribal elders urged people to come out en masse to vote for Mr Ghani, a Pashtun, to prevent a victory for Dr Abdullah who they see as a Tajik.

Image copyright Reuters Image caption US Secretary of State John Kerry (left) brokered the deal between the rival candidates

Laborious task

Ashraf Ghani, too, suspects that his rival Abdullah Abdullah's supporters have committed fraud.

Mr Ghani's team has lodged 1,800 complaints. They have not singled out a province but they have told the BBC that they are particularly worried about possible multiple voting for Mr Abdullah.

A breakdown of the results shows that Mr Abdullah's vote has remained broadly the same as in the first round in many provinces, except in Nuristan where his share has risen from 37% to 70%.

But again there could be a legitimate explanation for this.

The local governor is known to be close to Abdul Rasul Sayyaf, a contender in the first round. Many of Mr Sayyaf's supporters threw their weight behind Dr Abdullah in the run-off which could explain the surge in support in the province.

It's very difficult to draw any definite conclusions about the anomalies of the results in places like Khost and Nuristan in the absence of either reliable population figures, or voter registration records,

That leaves the IEC with the task of laboriously checking through piles of ballot papers to check for signs of multiple papers being filled in with the same handwriting - also not easy given that all that's required from each voter is a tick in a box.

But for Afghans and their international partners a lot now rests on this process. Over the past decade huge efforts have been made to build new institutions in Afghanistan.

If the elections can ultimately deliver a peaceful transfer of power from one elected president to another, then the country will have taken a crucial step forward.

But there's a long way to go.

Jenny Norton and Johannes Dell contributed to this story.