It is easy to miss the entrance to St Philip's secure unit for boys as you head into Plains, near Airdrie, but you know you are in the right place when you see the security barriers.
The car park is monitored by cameras. On entering the state-of-the-art building, visitors must put all belongings, including keys, mobile phone and bags into a locker. Airport-style security ensures metal objects are detected before entry is gained to the secure residence unit.
The staff do the same, but exchange their locker keys for a selection of others, including electronic fobs which allow them access around the site.
There are four six-bed units catering for children with different needs, from those with violent and criminal tendencies who have been sentenced or are on remand to those needing a place of safety. The functional but comfortable bedrooms have anti-ligature fittings, override facilities to prevent flooding in en suite bathrooms and a viewing panel so that staff can check on the occupants locked in for the night.
Children aged up to 18 are sent here because they have committed or are accused of committing serious offences, from culpable homicide and murder to assaults on police officers, or for less serious but persistent offending. For a smaller number, this is a refuge, sent for their own protection by the Children's Hearing system, because of issues at home and in the community.
The unit, which opened in March, is part of the Scottish Executive's drive to modernise and improve services for vulnerable children and to reduce youth offending.
In 2003, Cathy Jamieson, then the minister for education and young people, announced that an extra 29 places were being added to the secure estate to provide a wider range of accommodation and programmes, from support for young people with mental health problems to cognitive behavioural therapy and courses in anger management.
Now a total of 125 places are being provided in seven units across Scotland, three of which are new, including one just for girls. It is hoped they will set new standards and reverse the tide of negative stories surrounding residential care. The units are run by local authorities, independent organisations or charities.
The notorious Kerelaw case marked a new low for the reputation of institutional care earlier this year, when an art teacher and a care worker were jailed for physically and sexually abusing children at Kerelaw open school in North Ayrshire. The court case was preceded by a critical report from the Care Commission and the Inspectorate of Education, sparked by concerns about care and services. The report led to the closure of both Kerelaw open school and its secure unit.
St Philip's and Good Shepherd secure units for girls were further expanded to provide new places and replace those that would have been available at Kerelaw. The evidence is these extra places will be needed. In 2004-05, there were 273 admissions to secure units for children in Scotland, an increase of 13 per cent on the previous 12 months, and that was before two of the units opened. The total cost to taxpayers is pound;16.6 million, or pound;3,458 a bed a week.
To many people, particularly parents, the idea of locking up young children is abhorrent but in the eyes of the law in Scotland, a 10-year-old can tell the difference between right and wrong. Anyone of that age or older committing a crime may be given a custodial sentence.
For many, arrival at a unit is the result of poor relationships with parents or a chaotic home life reflected in a lack of boundaries and little positive attention from parents who have problems themselves or who lack parenting skills.
A review of 27 young people on remand in secure units over a six-month period in 2004 found common themes. The children were often from areas of high social deprivation, where violence and other crimes were common. Gang fighting was a feature of several teenagers' lives. Many had significant emotional and mental health problems. Of 14 with files on their educational background, only one had had uninterrupted schooling. All the others were educated outwith mainstream provision or had no schooling at all because of behavioural or attendance issues.
Sometimes children who were previously unknown to police and social work departments and who have supportive parents end up in secure units. At St Philip's, Pat McMullan, depute head of education at the unit, recalls how one boy on admission was fretting about sitting his Standard grades the next day.
"We sometimes get a visit from the family who are aghast at how their child got here," he says. "Peer group pressure is so strong. For young people of this age, what their peer group thinks of them is far more important than what their parents think."
St Philip's is a boys' secure residential school with modern ideas and Catholic values. The building is impressive. Set on its own, it is low rise and high spec, boasting an all-weather football pitch, fully equipped gym, 25m swimming pool and sports hall.
In the evenings the boys can watch television in the open-plan lounges, where the heavy purpose-built furniture cannot be easily picked up or thrown.
The unit is managed by staff appointed by the board of managers at St Philip's open residential school up the road and is a member of the Cora Foundation, a charity dedicated to Christian social care and education.
The school was established in 1970 as an independent Catholic residential centre for the care and education of secondary school boys who have emotional and behavioural problems and require specialist help with their education and interpersonal relationships.
Helping the troubled boys at St Philip's secure unit relearn how to build relationships, with both their families and others, is what Mr McMullan and his colleagues' jobs are about, and pivotal to that work is education.
"In terms of their life, they have spiralled down to being locked up," says Mr McMullan, who has been seconded to the unit from the open school. "Our vision is, if they are down here, the only way is up. It is about reconnecting. Education is critical to that."
It is hoped parenting skills classes will be introduced. "There is a deficit there, particularly for young men from the west of Scotland," Mr McMullan says. "It is about male relationships with women and children. It is about mother-and-son relationships."
Education is the focus for the boys sent to St Philip's from across Scotland, often many miles from family and friends. Each morning the duty officer lets the teachers know what sort of night the boys have had and if any will be absent for visits to court, children's hearings or doctor visits.
Lessons start at 9.15am and finish at 3pm (3.30pm on Wednesdays). Students follow a mainstream curriculum as much as possible, depending on the availability of teachers.
At the end of last term, there were difficulties hiring teachers for physical education and home economics, two key subjects with national shortages. Six full-time teachers and one part-time were providing extra cover for classes until the posts were filled in the new session.
The school day ends with a liaison meeting in each unit, where pupils are awarded points for good work or behaviour. They can earn up to 24 points each day, 28 on Wednesdays. More points can be gained outside school, which earn them access to television and radio.
The unit is not a boot camp but there are rules, such as no swearing or spitting when playing football, and keeping bedrooms clean. For many of the boys, who may be here for one night or several years, the staff may be the first people who have said "No" to them. The message is one of mutual respect for each other and for staff.
Teachers here are trained in safe physical intervention and de-escalation techniques. Already during my visit, the personal alarms which are mandatory for staff have gone off twice, once after a fight broke out in a classroom.
Physical activity is a valuable means of channelling both positive and negative energy. "What they do here we see as an education in another sense," says Mr McMullan, as we wander around the impressive sports and recreation department. "Physical exercise is important for academic success," he says.
Continuity is also important for these children, most of whom have had little structure in their lives and may have missed six months or a year of school, but units can find it hard to attract and retain staff for such challenging pupils. Several HM Inspectorate of Education reports on other units refer to staff shortages due to sickness or recruitment difficulties.
Patience is a key requirement. "Everything is a slow drip feed," says John O'Toole, the education manager. "Every day is different. A kid who focuses one day may not focus another.
"In a mainstream school, you get a buzz out of somebody passing their exam.
Here that comes from a guy learning to read or finishing a work sheet.
"There have been kids in here who have refused to come to class, and when they did come they would mess about. Now they are getting their national awards. Kids come in here with nothing and leave with certificates."
Last term about half of the 20 or so boys in the unit sat Standard grades, but passing exams is only part of the story at St Philip's. Students also attend sessions on issues that have brought them here, such as substance misuse and anger management.
"What is the point of giving a boy five Standard grades if he flies off the handle and is violent?" says Mr McMullan.
A 24-hour curriculum allows children to learn skills and develop social awareness out of the education block that will help with life beyond these walls. And when they do leave secure accommodation, care workers will set up support networks so they can harness the skills they have learnt and avoid falling back into old habits.
"We try our best to have the same breadth and balance as a mainstream school, but we are in a position to do something different with the 24-hour curriculum. Education is a lifelong thing. Even if it is not about having academic success, it is about realising that education can help you."
In the technical studies room, a boy is sanding down the edges of a wooden box he has made under the guidance of Peter McDermott, the craft, design and technology teacher. The 13-year-old, who has been at St Philip's for two weeks after committing a violent crime, has done a good job, but school does not seem to be his favourite place.
St Philip's, though, is better than he thought it would be. "I thought it would be shite," says the teenager. "It's all right. You just can't get out."
A 15-year-old who has been at the unit for three months, also as a result of committing a violent crime, is more sanguine. He recently sat Standard grades in maths and English.
"I like the swimming pool and the gym," he says.
"I thought it would be like jail. This is the first time I have been anywhere like this and I expected the worst.
"The teachers are sound." In a quieter voice he adds: "I miss my mum and dad and my pals."
Family visits and daily telephone calls from home are highlights of his days, which are otherwise taken up with school, football, going to the gym and getting the occasional takeaway.
He plans to go to college to learn a trade. During his time at St Philip's two things have happened: he has given up cigarettes - due to the unit's no smoking policy - and he's learnt: "You cannae go around doing things and get away with it."