Shock waves rippled through Edinburgh City Council in March after politicians disregarded education officials' advice and kept Castlebrae Community High School open.
Council staff argued that the school, which was just a quarter full, had "very poor" results, low attendance and a higher rate of exclusions than schools in similar circumstances. They wanted to close Castlebrae and focus on a new secondary due to open in the area in 2020. Most families in the catchment area were already sending their children elsewhere, they reasoned.
However, the local community of Craigmillar came out fighting. Students, parents and activists launched the "Save the Brae" campaign, and all made impassioned pleas to the council on the day of the decision about the school's future.
It was an emotional meeting, according to local SNP councillor Cathy Fullerton.
"In the end, we were not prepared to close a school in an area of such significant deprivation," she said. "We accepted the arguments of `Save the Brae', which put up a good campaign. We thought the school could be improved and we could do something to change the outcomes."
Now Ms Fullerton is chair of the group charged with developing a long-term improvement plan for the school by December. The group's recommendations will be informed by a report from an expert panel of advisers, due later this month. The six experts include Keir Bloomer, a former director of education; Ross Martin, policy director at the Centre for Scottish Public Policy; Dr Rowena Arshad, head of Moray House School of Education at the University of Edinburgh; and Brian Macalinden, credited with boosting exam results while headteacher at Castlemilk High School in Glasgow.
Transforming the fortunes of Castlebrae was "a seriously difficult challenge", Mr Martin said. Early on it would be about steadying the ship, driving up attainment and rebuilding some of the school's reputation, he said. Then attention would have to turn to the school's longer-term future: how it would link to the new school but also what would bind it to the community.
Castlebrae is dilapidated. Borders are overgrown, nothing shines, everything is tired. It oozes exhaustion.
Headteacher Derek Curran (pictured, inset), who joined the school in May, spent his first days in the job receiving feedback from Education Scotland inspectors, who were visiting the school for the second time after a poor inspection report in 2011. The follow-up report concluded that there remained "considerable headroom for improvement in young people's learning experiences and attainment". It was another blow, and led to more bad press for the school.
Improving staff and student morale is now one of the main challenges identified by Mr Curran, who has been seconded to Castlebrae for a year from Edinburgh's Forrester High School, where he has been headteacher for six years. Graeme Thompson, until recently headteacher at Castlebrae, has taken the helm at Forrester.
Mr Curran said he had plans to work with staff and students "to regenerate the vision of where the school is headed". He did not shy away from Castlebrae's shortcomings. It looked like Alcatraz, he said. "One of the first things the kids said to me was: `Can we get rid of the barbed wire?'"
Heart and soul
Mr Curran is not new to Castlebrae. He taught at the school for a large chunk of the 1980s.
"It was a fantastic school," he said. "It was challenging, as many schools in areas like this can be, but it was very much a comprehensive; everyone from the local community came here."
At that time, the school had more than 900 students; today, there are just 130, and only 10 in S1. Mr Curran remembers teaching Higher maths to classes of 30 students but now just four students are taking it on.
At times now the school resembled the Marie Celeste, he admitted - if you didn't know where the students were, you would not be able to find them.
A fund of pound;78,000 has been made available to Mr Curran to help him begin making changes. More money would be found if needed, Ms Fullerton told TESS. (Although doubtless nowhere near the pound;3.5 million surveyors estimated it would take to bring the building up to scratch over the next five years.)
Plans are afoot to improve the facade and to give the building a heart. Academic classrooms are being brought together in the same area. These will be refurbished and a large section of the school will be closed down.
"The kids need to get a better feel for their own school," Mr Curran said. "If we improve the building and the facade, the perception the community has of the school will follow."
Campaigners say the threat of closure that hung over Castlebrae for a decade led to its decline. The uncertainty encouraged families to drift away, Mr Curran said, adding that legislation allowing parents to choose their child's school, introduced in the 1980s, had a deleterious effect on secondaries based in large estates.
"There was the perception that these schools were not as good as schools in more middle-class areas. That wasn't true at first, but then that perception became a reality," Mr Curran explained.
In 1980, the roll at Castlebrae was 988 students. By 1990, it had fallen to 313, a drop of more than 68 per cent. Since then, the roll has remained low, and last year just 23 per cent of students in the catchment area chose Castlebrae.
Improving the quality of learning and teaching was "paramount", Ms Fullerton said. And this aim was one of the main reasons that Mr Curran was keen to take up the challenge.
He has introduced teacher learning communities to the school - regular meetings between teachers to embed formative assessment techniques in their practice. And this month every student received an iPad Mini, an investment of pound;30,000.
"Often the young people who face most challenges in their learning get less homework and take fewer jotters and books home because teachers are afraid they'll lose them and there will be nothing to submit at exam time," Mr Curran said. "This solves that problem."
There is also a new look to the staff line-up. Of the school's 26 teachers, seven are new arrivals.
David Hardman, a maths teacher, joined Castlebrae at the beginning of the school year. It is his first teaching post.
"Towards the end of the summer holidays, I did wonder if I'd made the right decision," said Dr Hardman, who worked in research at Edinburgh Royal Infirmary before becoming a teacher. "But if I'd wanted an easy life, I would have stayed in a lab and churned through data. I've been surprised by just how lovely and responsive the kids are. It's just a case of lifting their aspirations."
But there would be no swift turnaround in exam results and attainment at Castlebrae, Mr Curran warned. Almost half the students have additional support needs and literacy problems are rife. A score below 85 on the standardised reading test set by the National Foundation for Educational Research places a student in the lowest-attaining 20 per cent in Scotland. At Castlebrae last year, more than half of S6 (53 per cent), almost two- thirds of S5 (63 per cent) and more than two-thirds of S4 (69 per cent) scored below 85. Meanwhile, the bulk of this year's S1 - 79 per cent - fell into this bracket.
"If you look at the raw material coming into the school, the starting point is lower with each year that passes," Mr Curran said.
There are strengths to build on, however. In 2011-12, Castlebrae more than doubled the number of young people moving on to positive destinations from 42 per cent in 2010-11 (21 students out of 50) to 92 per cent in 2011-12 (48 students out of 52).
For the past three years, the school has also benefited from additional funding, which has enabled it to offer courses in subjects such as hair and beauty, construction and early years childcare. Castlebrae also offers qualifications in digital media and computer gaming, hospitality and retail. On a Tuesday lunchtime, the hospitality students run a cafe called Red. And recently they were at the Portobello Village Show selling homemade bread, jams, chutneys, cakes and biscuits.
Physical education, music, art and hairdressing got "great results", as did the technologies: home economics, craft, design and technology, and computing, Mr Curran said.
This was echoed by inspectors, who said in August that young people's performance in expressive arts, technologies and physical education was "relatively strong" and that they achieved "very well" in vocational education programmes.
However, in some respects, subject choice is narrow - the school offers neither physics nor geography, for instance.
"The areas we do need to improve in terms of attainment are the more traditional academic subjects," Mr Curran said. "That is where the challenge lies in the school."
One can't help thinking that there are more challenges than just a lack of oxbow lakes, but Castlebrae may have the right team in place to overcome them nonetheless.
An ally in the fight
Castlebrae boasts Edinburgh's only community of stringed-instrument makers.
They meet as part of the school's community programme, which in 2011-12 attracted 651 adults. The success of the adult education programme was a key weapon in the fight against the school's closure.
Also on offer are courses in English for speakers of other languages and classes ranging from art and beauty therapy to cookery and computing. There is a free gym and a family centre, which provides a creche and placements for Castlebrae students studying childcare.