Donald Trump and his advocates often boast of the Republican presidential candidate's philanthropic prowess. Central to their claims is the operation of his eponymous charity, the Trump Foundation. Recently, however, the Trump Foundation has come under media and partisan scrutiny. Detractors claim that it's not the unblemished source of selfless largesse that it has been made out to be.
What is the Trump Foundation?
The Donald J Trump Foundation is a private charitable organisation started by Donald Trump in 1987 with money he earned from his best-selling book, The Art of the Deal.
Up until about 2005, the foundation was primarily funded by Mr Trump himself, including a million-dollar contribution in 1989. Since then, however, it has been bankrolled almost exclusively by donations from Mr Trump's friends and associates.
According to its 2014 filing with the Internal Revenue Service (the most recent on record) the foundation claimed assets totalling $1,273,895 and brought in $500,849 - almost entirely from a gift from New York ticket-reselling mogul Richard Ebers, a regular contributor. The foundation gave out $591,450.
Other past prominent Foundation donors include Vince McMahon, the professional wrestling impresario and NBC Universal (which aired Mr Trump's show, The Apprentice).
Many of the contributions to Mr Trump's foundation appear to be in lieu of payments to Mr Trump himself. People Magazine gave $150,000 after it received rights to publish photos of Mr Trump's son, Barron. Comedy Central donated $400,000 after Mr Trump appeared on one of its celebrity roasts.
Several dozen charitable groups received contributions in 2014 - about an average number for the foundation. They included the Alliance for Lupus Research, the American Skin Association, the Anti-Defamation League and a variety of veterans' charities.
In 2009 the foundation gave $100,000 to the Clinton Foundation.
The Clinton Foundation? So is the Trump Foundation kind of the same deal?
No! Well, they both have the word "foundation" in their names, but other than that there really aren't many similarities.
First of all, the billion-dollar Clinton Foundation is much, much bigger. It employs a staff of 486 and thousands of programme workers, while the Trump Foundation's board is Mr Trump, his oldest children and a treasurer. It has no paid employees.
The Clinton organisation is what's called an "operating foundation" or "public charity" - which funds and manages its own on-the-ground programmes. The Trump Foundation, on the other hand, serves as a pass-through for donations to other groups, which then perform charitable functions. Per IRS regulations, it's categorised as a "private non-operating foundation".
The nonprofit monitoring organisation Guidestar has given the Clinton Foundation a "platinum seal" of transparency for providing additional information on its operations. The Trump Foundation has declined to furnish requested details.
"The Trump Foundation's approach would certainly not meet the standard of focused, proactive grantmaking commonly called 'strategic philanthropy,'" writes Guidestar president Jacob Harold.
The two foundations do have a bit in common, however. They're both associated with individuals seeking the presidency in 2016, and they've both been the target of allegations of impropriety.
So why has the Trump Foundation become controversial?
Compared to the Clinton Foundation, the Trump Foundation hasn't received nearly as much media attention, but the stories that have come out have painted a sometimes-less-than-flattering picture. Here are some of the reasons why:
Co-opted credit: Mr Trump has repeatedly claimed that he's making a donation to a charity only to fund that donation with money from his foundation. Given that at this point the foundation's funding comes from outside sources, he is in effect taking credit - and being lauded - for simply passing charitable donations along.
The Washington Post's David Fahrenthold, who has conducted extensive investigation into Mr Trump's charitable involvement, cites the "Palm Tree Award" Mr Trump received for a $150,000 donation he made (from his foundation's money) to the Palm Beach Police Foundation. That donation came only after the Trump Foundation had received a $150,000 contribution from the New Jersey based Charles Evans Foundation, however. When the Evans Foundation donations stopped, the money to the police charity from Mr Trump's foundation ended as well.
"Trump had effectively turned the Evans Foundation's gifts into his own gifts, without adding any money of his own," Fahrenthold notes.
Mr Trump also benefited from the fact that the Police Foundation holds its annual charity dinner at Mr Trump's Mar-a-Lago club in Palm Beach. In 2014, for instance, the charity paid the club $276,463 in rental fees. Mr Trump often gave foundation donations to groups that were paying top dollar to hold events on his properties.
Personal purchases: Although much of the money in the Trump Foundation has been gifted to other charitable organisations, some of it has been spent on purchases from charity auctions, including $20,000 for a 6ft tall painting of Mr Trump in 2007 and $12,000 for a football helmet signed by NFL quarterback Tim Tebow in 2012.
The whereabouts of those two items are currently unknown. If they stayed in Mr Trump's possession, it would appear to be a violation of US tax law prohibiting "self-dealing" - where managers of charitable groups purchase gifts for themselves from foundation funds. If the IRS determines this was the case, Mr Trump would have to reimburse his foundation for the market value of the purchase and pay a penalty.
Questionable donations: As Mr Trump began attempting to curry favour with Republicans in recent years, more of his donations have been directed to conservative causes. In 2014 he made a $10,000 donation to the American Spectator Foundation, the nonprofit group that publishes the arch-conservative magazine of the same name.
The Trump Foundation also made a $100,000 donation - its largest gift of that year - to Citizens United, a conservative group best known for a lawsuit that ended with the US Supreme Court striking down limits on many of the kinds of political campaign donations Mr Trump has criticised during his candidacy.
These kinds of donations, while representing a shift in the foundation's charitable giving patterns, are perfectly legal. In 2013, however, the Trump Foundation made a $25,000 contribution to "And Justice for All", a campaign committee supporting Florida Attorney General Pam Bondi. Political donations of this kind from a charitable foundation are prohibited. When the contribution was discovered in 2016, Mr Trump moved $25,000 from his personal account to compensate his foundation and paid a $2,500 IRS fine. Trump Foundation representatives have said the contribution was made in error.
As multiple news outlets have pointed out, the original donation arrived just days after Florida announced it was not joining a multi-state lawsuit against Trump University - a Trump-branded for-profit company that offered real-estate seminars and has been accused of fraud. A New York Times open-records request found no evidence that Ms Bondi was directly involved in that decision, however.
OK, Trump paid a fine. Does the foundation have any other legal troubles?
Yes. New York Attorney General Eric Schneiderman - the Democrat who is spearheading the investigation into Trump University - announced on 3 October that he has ordered the Trump Foundation to stop fundraising.
The foundation had neglected to register under article 7A of New York's Executive Law, which is required for any charity soliciting more than $25,000 (£19,440) a year, a letter from Schneiderman's office said
Trump officials have denounced the investigation as partisan.
Democrats in Congress have requested that the US Department of Justice initiate a criminal investigation into the Bondi donation for possible violation of federal bribery laws. The left-leaning Citizens for Responsibility and Ethics in Washington has made a similar request of a US attorney in Florida - although proving such quid-pro-quo cases is extremely difficult.
In addition the group has filed a formal request that the IRS revoke the Trump Foundation's nonprofit tax status - an action the IRS will likely only take if it finds egregious and repeated violations of its regulations.
But Trump says he gives lots of money to charities. Is he lying?
Because Mr Trump hasn't released his tax returns, there's no way to tell exactly how much he gives to charities. The Post's Fahrenthold has been doggedly trying to track down any and all of Mr Trump's personal donations but has only identified one gift, of less than $10,000, between 2008 and May 2016.
In May, four months after pledging to do so and after heightened media attention, Mr Trump donated $1m to a veterans' charity. The Republican candidate has also recently donated $100,000 to a charity aiding relief efforts following devastating floods in Louisiana.
Mike Pence, the Republican vice-presidential nominee, said on 12 September that his running mate "has given away tens of millions of dollars to charitable causes throughout his business life".
The Trump campaign released a list of charitable donations it says the candidate has made totalling $102m over the past five years - but the items listed were either in-kind contributions such as free rounds of golf at Mr Trump's courses offered at charity auctions and land-conservation agreements or money originating from the Trump Foundation.
"The Foundation's second-biggest donation described on the campaign's list went to the charity of a man who had settled a lawsuit with one of Trump's golf courses after being denied a hole-in-one prize," Fahrenthold and the Post's Rosalind Helderman write.