A man who preyed on troubled children at the former Kerelaw School in North Ayrshire is back in prison after losing his appeal against conviction.
Former art teacher Matthew George was jailed for 10 years in 2006 for a series of physical and sexual assaults at the Stevenston school.
The 61-year-old, from Largs, had been freed on bail to await the outcome of his appeal.
Kerelaw was closed in 2006 following a police probe into incidents of abuse.
The residential school was originally run by Strathclyde Regional Council and its successor, Glasgow City Council.
Some of the pupils there had family problems which kept them away from home, some were truanting from school and others had been sent there for offences involving violence, theft or drugs.
George was suspended and later sacked from his position after the allegations against him first emerged.
His trial heard how George helped out in the pupils' living quarters when the school was short-staffed.
His victims were mostly boys aged about 14 or 15 and the offences dated back to 1978.
The trial heard how George would boast about his own sexual exploits, expose himself to boys in the shower, demand oral sex and, on one occasion, attempt to sodomise one of his pupils.
He would also use pupils as guinea pigs to show off his martial arts skills, subjecting them to punches and slaps and painful wrestling holds, sometimes completely without provocation.
George was jailed for 10 years after the jury found him guilty of 18 charges of physical and sexual abuse against pupils.
In his bid to overturn the conviction, George's legal team had complained that they were not given adequate access to paperwork at Ayr Police Office during the investigation.
They claimed that prosecutors failed to disclose statements which had been made to social workers investigating complaints of ill-treatment at the school.
The lawyers also claimed that more than 100 individuals had come under suspicion at the school.
If they had been given a list, the defence argued it might have found evidence of false allegations which could have helped George at his trial.
George had also complained that his lawyers at the trial had not done a good job for him and that trial judge, Lady Paton, had wrongly allowed the jury to hear hearsay evidence.
Delivering the decision at the Court of Criminal Appeal in Edinburgh, Lord Osborne said: "It was clear from the witnesses' evidence and demeanour that many of them had, as children, been very afraid of the appellant (George).
"Some of the incidents were nightmarish."
Lord Osborne noted that if any ran away, because of their ill-treatment, George would be waiting for them when the police brought them back.
"The fear, unhappiness, pain and humiliation suffered by some of the pupils as children at Kerelaw has affected many of them throughout their adult lives," he said.
The appeal judges made minor alterations to two charges - deleting an allegation that one boy had been pelted with golf balls and that an assault which involved slapping a girl on the head had happened only once, not several times.
Another hearing will be set will allow George to challenge the 10 year sentence imposed at the end of a his trial in 2006.