Profile: Jim Murphy, Scottish Labour leader
Five months ago Jim Murphy was elected leader of the Scottish Labour Party, and he had big ambitions.
He would oversee the re-election of Scotland's 41 Labour MPs, he would win a seat at the 2016 Holyrood election and he would become the next first minister of Scotland.
But the plan has not worked out.
At last week's general election, Mr Murphy was one of the defeated candidates as Labour lost 40 Westminster seats to the Scottish National Party.
He survived a vote of no confidence from the party's national executive - but then announced he would resign next month anyway.
VIDEO: Jim Murphy's last six months
It was all so different on 13 December when a delighted Mr Murphy was made leader of Labour in Scotland, beating rivals Neil Findlay and Sarah Boyack with 55.77% of the vote.
He spoke about uniting his party, of creating a Scotland based on social justice, and of ending poverty and inequality.
Mr Murphy had the winner's CV - he had been involved in Labour politics for more than two decades and against the odds he had won the safe Tory seat of Eastwood at the 1997 general election.
He had remained MP for the constituency after it underwent boundary changes in 2005 and was renamed Renfrewshire East.
During his time at Westminster, the father-of-three had clocked up years of ministerial experience including being:
- Minister for the Cabinet Office from November 2005 to May 2006
- Minister of State for Europe from June 2007 to October 2008
- And Secretary of State for Scotland from October 2008 to May 2010.
The keen runner and vegetarian was born in 1967 in Glasgow and raised in a housing scheme on the city's south side, but at the age of 12 he emigrated with his family to South Africa.
Mr Murphy returned to Scotland in the 1980s in order, as he said later, to avoid having to serve in the South African army.
His involvement in student politics culminated in a two-year presidency of NUS UK, beginning in 1994.
During his time at the helm, the union dropped its opposition to the abolition of student grants, which was in line with Labour Party policy.
However, it was something Blairite Mr Murphy has never been allowed to forget.
Outside politics, the Celtic fan hit the headlines when he helped survivors after a police helicopter crashed onto the Clutha pub in Glasgow in November 2013.
The former MP was in the area at the time of the crash and said he ran into the pub to help before emergency services arrived.
Interviewed at the scene by the BBC, he said: "Like other people, you just do what you can to help."
Even before there was a vacancy to replace Scottish Labour incumbent Johann Lamont, party people and media alike were talking about Mr Murphy as a future leader.
That speculation was put to the test when Ms Lamont resigned with immediate effect a few weeks after the referendum.
Despite Labour being on the winning side of the Scottish independence vote, there was discontent with Ms Lamont and, as she put it at the time, senior party members had "questioned my role in this new phase" of Scottish politics.
As soon as the Glasgow MSP was gone, Mr Murphy was seen by many as the front-runner to replace her, with one figure saying: "If Jim doesn't stand it will be a disaster."
Hit by eggs
The politician did not shy away from the tough referendum campaign, touring 100 towns in 100 days to deliver the "No" message.
It was not 100 consecutive days, as it was suspended for 72 hours, after Mr Murphy was hit by eggs while campaigning in Kirkcaldy, Fife.
He blamed "co-ordinated abuse" from "Yes" backers, although the Yes Scotland campaign said it condemned "all forms" of abusive behaviour.
While Mr Murphy's brand of street politics earned him much praise it also marked him out as a divisive figure on the campaign trail.
His mission at the start of his leadership was to unite his party, not to divide it.
However, nearly half a year later, as Mr Murphy stood in a hotel in Glasgow announcing his resignation, he said that he felt divisions in the party would continue if he remained as leader.