If one were to try and construct the ideal curriculum vitae for a candidate who might one day become the first female president of the United States, then the end result might not look too different from the resume of Mrs Hillary Clinton.
Over the past three decades in public life, the 69-year-old has amassed an almost unparalleled list of political achievements including being the first former first lady to be appointed secretary of state.
And with two days to go before the election, she holds a slight edge over her rival Donald Trump. It is a far from comfortable gap and one certainly not reflective of the significant advantages she had entering the final stretch - a favourable electoral map, more volunteers and more money.
A large part of the problem stems from Mrs Clinton's own flaws as a politician. For all the strengths of her CV, she is seemingly ill-suited for the American political system.
Mrs Clinton doesn't have the charisma or the personal touch of President Barack Obama and has shown an almost self-destructive paranoid insistence on privacy.
That said, this election is still Mrs Clinton's to lose.
Her path to the White House runs likely through a series of mid-western states - Michigan, Wisconsin and Pennsylvania - which President Obama won and where she holds a lead. Defend that firewall, and Mrs Clinton can win the White House without worrying about the outcome in the states where the race seems the tightest.
A candidate becomes president by winning 270 electoral college votes. Every state is allocated a number of electors based on its population. Hence, even the most pessimistic forecasting model gives her a two in three chance of winning. But she has shown over and over again throughout her career that, for her, nothing really comes easy .
Born Hillary Diane Rodham into a middle-class family in 1947, Mrs Clinton's father Hugh Rodham owned a successful fabric business. Her mother Dorothy Emma Howell Rodham stayed home to look after Hillary and her two younger brothers.
Though Mrs Clinton is the Democratic flag-bearer now, her father was a staunch Republican and, in her teenage years, she herself was active in Republican groups. She even volunteered with the campaign of Republican presidential nominee Barry Goldwater in 1966. It would only be later in college that she became a Democrat.
PRIVATE E-MAIL SERVER
This is the most serious of scandals that Mrs Hillary Clinton has been embroiled in. While serving as secretary of state from 2009 to 2013, she used a private e-mail server located in her New York home for all her work e-mails.
While use of the server may not have been explicitly disallowed at the time, there remain big question marks over whether she ever intentionally communicated classified information through the unsecured server.
Many critics also doubt her staff had turned over all relevant e-mails to the State Department. Though a Federal Bureau of Investigation probe initially concluded that her actions, though careless, did not warrant criminal charges, it announced that it is looking through a trove of newly discovered e-mails.
With overlapping roles and interests in the Clinton Foundation and in the State Department, Clinton critics accuse the Democratic nominee of using her official roles to benefit her private foundation.
There is a complicated web of crossed connections and top aides who had roles in both the State Department and the companies linked to the foundation. A report also indicated that foreign donors to the foundation got access to the secretary of state. Mr Donald Trump called it "pay for play", but there has never been any concrete proof of wrongdoing.
Through much of the last month, WikiLeaks released an almost daily cache of e-mails hacked from the account of Mrs Clinton's campaign chair John Podesta.
Among the embarrassing revelations was the fact that she got questions to CNN town hall ahead of time, and a speech to a Wall Street bank where she spoke about it being necessary to have a private and public position. The Clinton campaign argues that the WikiLeaks e-mail dump is an attempt by Russia to intervene in US elections.
Mrs Clinton credits her parents with shaping her outlook on life. Her father was famously strict and tightfisted as well as stingy with praise. When she brought home straight As, she recalled her father would say: "Well Hillary, that must be an easy school you go to."
She also said her father was the one who instilled in her a belief that she could do whatever boys could. When she wanted to learn how to hit a curveball in baseball, her father made her spend countless hours on drills until she got it.
Mrs Rodham was apparently no easier on her children. At the Democratic Party convention in July, Mrs Clinton told the story of how her mother taught her to deal with bullies. "When I tried to hide from a neighbourhood bully, she literally blocked the door. 'Go back out there,' she said."
Mrs Clinton attended Wellesley College in Massachusetts and later Yale Law School. It was at Yale that she would meet Mr Bill Clinton.
The famous story of how the political power couple came together goes something like this: Though they caught each other's eye, both were too shy to actually speak to one another. That ended one day in the library after an awkward staring contest.
Said Mr Clinton: "She walked the whole length of the library, came up to me and said, look, if you're going to keep staring at me and now I'm staring back, we at least ought to know each other's name. I'm Hillary Rodham, who are you?"
The pair were married in 1975 in the living room of their small home in Fayettevile, Arkansas. Only 15 people attended the ceremony. Their only child, Chelsea, would be born five years later.
In the early years of marriage, Mr Clinton was busy working his way up the political hierarchy in Arkansas. When he became governor of the state, she used her position to advocate for education and children's health. When Mr Clinton entered the White House in 1992, he described his wife as an important and active partner. Elect him, he said frequently on the campaign trail, and the voters would be getting "two for the price of one".
And indeed, Mrs Clinton was an unusually active and influential First Lady. No First Lady had ever been asked to deal with an issue as heavy as healthcare reform and rarely had one been accorded as much professional respect as the occupant of the White House.
Unfortunately, her time in the White House today is often clouded by her husband's affair with intern Monica Lewinsky. In her memoir Living History, Mrs Clinton described her decision to stay married as one of the most difficult ones she had to make.
Two years after the Clintons left the White House, Mrs Clinton embarked on her own political career. She won the Senate race for New York in 2000, and easily won re-election in 2006. But she was only warming up. A year later, she decided to make her first bid for the highest office in the land.
For the 2008 campaign, as was the case this year, Mrs Clinton became the favourite the moment she entered the race. In both instances the Clinton juggernaut held wide polling margins ahead of the primary elections and in both instances, a charismatic leader that captured the imagination of young voters would mount a serious challenge.
Her first attempt would ultimately fail - her campaign was often dysfunctional and the contest with then Senator Obama was often fierce and competitive.
Still, her campaign had been seen as an important step forward for women. "Although we were not able to shatter that highest and hardest glass ceiling this time, thanks to you it has 18 million cracks in it," she said in a well-received concession speech.
When she eventually became secretary of state, the American public got to see Mrs Clinton at her best. Her approval ratings rose and she went on to become one of the most travelled diplomats in US history. In Asia, Mrs Clinton will be remembered as the first person to articulate the administration's rebalance.
But her final few months in the job would also provide some of her most problematic moments.
An attack on a US diplomatic compound in Benghazi, Libya triggered a series of investigations and hearings into whether there was any wrongdoing on the part of Secretary Clinton. The investigations also led to revelations that Mrs Clinton used a private e-mail server while in public office. The Federal Bureau of Investigation director James Comey would eventually describe Mrs Clinton as being "extremely careless". The e-mail issue would emerge as one of her biggest challenges in this year's campaign - one that she arguably never fully came to terms with.
Still, Mrs Clinton evidently learnt a lot from her first shot at the White House. Indeed, she set about learning all that the Obama campaign did right in preparing for the 2016 campaign. She even hired many of the President's former advisers.
While realising she would never achieve the ease of more gifted politicians, she focused on becoming more relatable and also sold her strengths as a policy wonk.
Then on July 26 - at the end of what turned out to be an unexpectedly bruising campaign - she succeeded where she had failed eight years ago. She became the first woman to be the presidential nominee of a major political party. Next week, she will try and go one better.
Jeremy Au Yong