People around the world are stunned at the rise of Donald Trump - from complete outsider to Republican nominee for the US presidential election, in what might yet turn out to be a close race to the White House.
At the start of campaigning for nomination, almost nobody gave Trump a chance. One article even suggested that he had a better chance of playing in the NBA finals than winning the Republican nomination. Now, he may become the president of the United States.
Commentators and analysts have offered many reasons for how the outspoken billionaire has come so far, but what insights can scientific research provide? And what can it suggest for how the US can move beyond the polarisation caused by this highly divisive election campaign once a new president has been elected?
In-group versus out-group
According to a recent study by two political scientists, who compared the language of the major political candidates for the 2016 American presidential election, Trump presents a "unique combination of anti-expertise, anti-elitism, and pronationalist sentiments." And his supporters show "high levels of conspiratorial thinking, nativism, and economic insecurity."
In this, Trump fits nicely into the mould of populist politics - his language appeals to the idea that the elite group holding power mistreats ordinary citizens. And that by working together, he and his supporters can overthrow the elites and return power back to the people.
Trump uses the old political trick of creating a view of the world as divided into "us" and "them". And he focuses on two key messages that reinforce this division: stopping immigration from certain groups and "making America great again".
His identification of immigrants as an "out-group" creates a shared identity for his followers as the "in-group". Politics becomes a competition between us, the "good" people, against the "bad" criminals and terrorists. This technique has been used by people in power since time immemorial, and who the bad people are changes according to the situation.
Focusing on out-group threats may be an old trick but it's effective because our brains are highly sensitive to out-group attacks on in-group members. From an evolutionary perspective, out-group attacks often posed an existential threat to the in-group, which required rallying behind the in-group leader for protection.
Behind the idea of making America great again, Trump's key message is that the national elite made bad trade deals that shipped manufacturing job overseas. It's true that the percentage of US workers employed in manufacturing has declined from 24% in 1960 to 8% in 2016. And regardless of whether this loss was caused by bad trade deals, people who lost their manufacturing jobs believe his message.
This explains why Donald Trump is so popular with white, male, working class Americans who were typically employed in these industries. Again, by invoking an "us" (the hard-working common people) versus "them" (the ruling corrupt elite), Trump rallies a large group of people behind him.
Not surprisingly, in the time since Trump declared he was standing for US presidency, the American electorate has split into two groups that strongly oppose each other. On the one hand, minorities, women and left-wing college-educated liberals mainly support Hillary Clinton, while white working-class males, evangelicals and right-wing conservatives mainly support Donald Trump.
Both groups claim the moral high ground, maintaining that it is they who uphold universal standards and adhere to them.
According to moral foundations theory, which tries to understand why morality varies between different people and cultures, both groups might be right because they're actually driven by different moral motivations. Psychological research shows both left and right-wing voters are motivated by kindness and fairness, but the latter are significantly more motivated by authority, traditions, sanctity and loyalty to in-group members.
This difference in moral perspective between Democrats and Republicans might be one of the reasons why political polarisation in America is so significant. But whoever wins the election will have to govern for the whole of the country, so how can these views be brought closer together?
People might think that using logical intellectual arguments is the most efficient way to win people over. But, according to psychology professor Drew Weston, this strategy might be largely ineffective. In his 2008 book The Political Brain, he argues that the reason why Al Gore and John Kerry lost against the "less intellectual" George Bush in the 2000 and 2004 US presidential elections was because Bush was much better at appealing to voters' emotions.
He says voters are not cool calculators who make rational decisions based primarily on policies. Rather, elections are often decided by how people feel - first, by how they feel towards the parties and their principles, and then by how they feel about the candidate.
And once people have made up their minds about a party or a person, it's very hard to change their view. In fact, people actively seek information that confirms their beliefs and will often ignore contradictory information, in a process known as confirmation bias.
My colleagues and I found further scientific evidence for confirmation bias in a recent neuroimaging study. We found that brain areas involved in processing information were more active when people observed positive messages from in-group political leaders, and negative messages from out-group political leaders. This suggests people like to hear messages that confirm what they already believe, such as our group is "good" and the other group is "bad".
In this sense, Donald Trump might have had a point when he said that he could shoot someone on Fifth Avenue and his supporters would still vote for him.
What can be done
How, then, can the incoming US president heal his or her fractured country and move people from the extreme left or right of the political spectrum to the centre? If Hillary Clinton wins, she will have to take people's concerns about illegal immigration and manufacturing job losses seriously.
Research by political scientist, Kai Arzheimer, suggests that stemming the rise of extreme right-wing views might require lowering immigration and unemployment. While everyone will agree that lowering unemployment rates is a good thing, reducing immigration might be unpalatable for some on the left.
Recent figures suggest there are currently around 11 million undocumented immigrants and 42.4 million immigrants in total in America. But it's not necessarily the total number of immigrants that matters; rather, it's the notion that some immigrants pose a perceived economic or cultural threat - or both - to its citizens.
People on the right side of the political spectrum are highly sensitive to the arrival of people from different cultures into their country because they see them as undermining their key moral foundations of authority, purity and loyalty to in-group culture. This might explain why German Chancellor Angela Merkel's open-door policy towards asylum seekers may have given a boost to extreme right-wing views in Germany.
Psychology research shows that when people feel under threat their political opinions move to the right. Having a solid immigration policy, then, is essential for curbing right-wing extremism. In the same sense, extreme left-wing views, such as open borders and unlimited immigration, may have the opposite effect of what their supporters hope to achieve.
All this suggests that tackling unauthorised immigration into America should be a priority for Democrats as well. Once this is the case, support for legal immigration is likely to grow and a path to legalisation for current undocumented immigrants could open up.
This will not only benefit American citizens, who will feel their territory is secure, it will also benefit current undocumented immigrants, who won't have to live in fear of deportation anymore. And the sense of security that a solid immigration policy imparts will reduce extreme right-wing tendencies in the whole of the population.
As for reducing unemployment, international free trade agreements might be good for trade and the economy in general. But given the opportunity, companies that rely on low-skilled labour will often shift their production to countries with the lowest wages.
While low-skilled people in China and Mexico and high-skilled people in the United States have benefited from free trade agreements between their countries, many low-skilled people in the US have lost their manufacturing jobs. Since these people perceive that their job is taken away by agreements made by their national elite, they rebel and follow the populist leader who promises to solve their problems.
One way to increase trade while protecting manufacturing jobs might be to limit comprehensive free trade agreements between countries with similar economies. The recent trade agreement between Europe and Canada, for instance, might increase trade without reducing manufacturing jobs in either because average manufacturing wages between the two partners are alike.
Free trade agreements between countries with unequal economies might still be possible in the future but leaders might need to negotiate better deals that are beneficial for all their citizens.
Similarly, if Donald Trump wins, he will have to overcome a large group of sceptics.
To win over the general public, he will have to change his populist rhetoric and embrace a vision for America that everyone can identify with. This means listening to groups on the left side of the political spectrum, and addressing the concerns of minorities by softening his rhetoric on immigrants and looking at the issues raised by groups such as Black Lives Matter.
Economic research shows that social cohesion is vital for good institutions and growth. If Trump wants to succeed in "making America great again", he has to make sure that everyone is on board.