Jay McMillan is only seven, but he "used to walk around the school like he owned it," says his mother. He would throw chairs and swear at teachers. When distressed, he would start up a pretend car and take it careering round the classroom.
But there has been a dramatic change in the P2 pupil, whose father died two years ago.
"I got Jay back," says his mum, Lana Anderson. She knows exactly what made the difference: a special room in Edinburgh's Niddrie Mill Primary.
The Retreat, where pupils work with behaviour support teacher Sandra Bonthrone, is a calming place. Pan pipes music plays, and there are cushions to lie on. Seven children spend most of their week here, while others drop in less regularly.
Each desk has an "emotions ruler". Pupils put an arrow next to a number: 1 means they feel terrible; 10, they're on top of the world. They find it hard to express themselves, but the ruler lets Mrs Bonthrone see instantly how they are feeling. Recently, one boy hurried in after getting some jags and thumped his ruler to the edge of the desk - there wasn't room for his unhappiness.
In one corner, a constantly-playing slideshow projects photos of positive things that have happened in The Retreat. Mrs Bonthrone never uses anything that is more than a couple of days old.
But she stresses that The Retreat is not just a succession of inventive strategies to help troubled children: "It's more than a room - it's a philosophy, an ethos."
As Leon Clark (P7) observes: "The Retreat's a great name - it's not a `class' or `office', or `room'."
HMIE, in an inspection report published in December, singled out The Retreat as good practice. The school as a whole - which is in Craigmillar, an area with one of the highest crime rates in Scotland - was deemed "outstanding" in meeting emotional needs.
The Retreat has support from throughout the school and beyond; charity Place2Be, for example, provides counselling. Mrs Bonthrone praises headteacher Sadie Miller who "thinks out of the box", trusts staff to come up with ideas, and places big responsibilities on pupils.
P5s Megan Flockhart and Shondele Hunter were stoical "buddies" for Jay. "He used to hit us. He used to swear at teachers. But we would tell him off. We made him a behaviour sheet - if he's good, he gets smiles. We pretended we were his parents. We used to buy him bananas."
Teachers, too, know how important it is to support pupils when they are away from The Retreat. Jennifer Goodall once said she would faint if Dale Harrison, a P6 pupil, ever arrived first for maths. Dale has a workbook which proudly displays a photo of Miss Goodall, prostrate and in shock.
Children have made remarkable progress. When six-year-old Jason Siller (P1) first came to The Retreat, he tried to grab a fish out of its tank and swore at Mrs Bonthrone when she intervened. He had a predilection for kicking people, and his dad was on the point of removing him from school.
When an HMIE inspector visited last year, Jason persuaded her to join in with a ball-catching game. As she left the room, Jason ran after her. Mrs Bonthrone thought he was about to kick her; instead, he held the door open and said: "There you are, visitor." Mrs Bonthrone "started to breathe again".
Nine-year-old Billy Casement (P5) used to get angry when a book was put in front of him: he could not read a thing.
His dad, also Billy, marvels that after five weeks in The Retreat, he came home with a book and "read the whole thing".
Parents are regular visitors to The Retreat, where they can get support and guidance. They lean forward on their seats to emphasise how important Mrs Bonthrone's room has been to their children's progress.
Billy's classmate Andrew Tulloch used to become lost in fantasy worlds - he'd be a wrestler or a footballer - and would constantly disrupt his class with silly noises.
"This is a haven," says his mum, Kelly. "It's a place where there's no pressure. It calms you. If it wasn't for The Retreat, Andrew wouldn't be at this school any more."
There is a remarkable determination at Niddrie Mill to give children every chance of a full return to classes away from The Retreat. "Without this support, the children would have difficulty staying in mainstream education, but we help reintegrate some," Mrs Bonthrone says.
Jordan Hunter (P6) refused to come to school for months. One day, Mrs Bonthrone decided she should visit him at home. Jordan ran off and buried himself under a duvet. It took a long time, but now he goes to school every day. The Retreat provides him with the security his duvet once did.
Ann Muir, grandmother of Jay, says: "The kids just automatically slap their hands into hers - Mrs Bonthrone should get a medal. I've been here in tears and she's been so reassuring. I had actually given up on Jay."
The seven-year-old, who used to run amok in school, puts his head round the door. Mrs Bonthrone asks if he would like to be interviewed by The TESS.
But Jay explains he has another urgent appointment - he couldn't possibly miss buddy reading.