Malky Mackay's appointment as the Scottish FA's new performance director has proven controversial.

As he prepares to arrive at Hampden, accusations of racism still surround the 44-year-old following his controversial exit from Cardiff City in 2013.

The third man to take up the high-profile position after Mark Wotte and Brian McClair, his role involves all aspects from performance schools all the way up to Gordon Strachan's senior national team.

While the move has received backing from some of Mackay's former colleagues, including Brendan Rodgers and Mark Warburton, others have expressed their reservations over the appointment.

Once considered one of Scotland's most promising managers, Mackay has been out of football since being sacked by Wigan Athletic in April 2015.

So why has Mackay's appointment cause such consternation? We take a look at the issues surrounding the former Scotland international's fall from grace.

Mackay was originally accused of sending messages containing racist, homophobic and sexist language during conversations with Cardiff City's head of recruitment Iain Moody.

The messages came to light in August 2014 while Mackay was in the running to be reunited with Moody at Crystal Palace.

Other correspondence between the pair was said to include comments about a Jewish football agent as well as an official at another club.

Mackay claims he only sent three messages, of which two were reportedly of a racist nature.

He denies sending any messages containing sexist or homophobic content but has not rejected claims he received them from a colleague.

The Daily Mail says one of the messages from Mackay referred to Cardiff City's Malaysian owner Vincent Tan, calling him a "chink".

The message read: "Not taking no for an answer from the chink until the 20th time or unless somebody big blows us out of the water. Can you tell him that."

Another message saw Mackay admit to calling South Korea international midfielder Kim Bo-kyung and his representatives "fkn chinks".

In his initial statement, released through the League Managers Association, Mackay claimed he was "letting off steam to a friend during some friendly text message banter".

The LMA later issued an apology for the remark following widespread criticism.

The Football Association carried out a nine-month investigation with a statement in July 2015 confirming no action would be taken against Mackay.

After speaking to 27 witnesses in the UK and abroad, and having the evidence reviewed by a QC, the governing body said their rules did not allow for charges to be brought for private correspondence.

Both Mackay and Moody were warned about inappropriate language with the FA.

Leading anti-racism group Kick It Our criticised the FA's decision, claiming they had damaged their own credibility.

They said: "It is Kick It Out's view that the FA needed to take a strong position to help prove football's 'zero-tolerance' approach towards discriminatory practices.

"Instead, we have another example of the status quo being reinforced and discriminatory practices being allowed to flourish in 'no-go' areas such as within the exclusivity of boardrooms, training grounds and dressing rooms and via private communication networks.

"How can anybody truly challenge discrimination and prejudiced attitudes in football with confidence now?

"The case symbolised a serious challenge to the leadership of football and sadly the FA has missed a key opportunity to send out a message to individuals who use private communications to express such unacceptable views."

Mackay apologised for sending three messages which were "completely inappropriate and unacceptable", adding he was under "immense pressure and stress" at the time.

The Scot said there was "no excuse" for his actions and told the BBC: "I am no racist. I am no sexist. I am no homophobe and I am not anti-semitic. It is the people who don't know me I've got to convince of that."

Mackay volunteered to undertake equality and diversity training.

In November 2014, he was appointed as the new manager of Championship side Wigan Athletic but was sacked after 138 days.

While announcing the appointment, then-Wigan chairman Dave Whelan said: "Contrary to the way he has been portrayed in recent months, the Malky Mackay I met this week, and who has been vouched for by the many different people from whom we have sought advice before making this appointment, is an honourable man.

"He is a committed family man with decent values and is a professional who has worked and thrived for over 20 years in the multicultural world of modern football."