As someone with a reputation for enhancing the reputation of schools, Gordon Ford was set a stiffer challenge than usual when he arrived at Inveralmond Community High in Livingston in 2001 - and West Lothian Council knew the odds, not least because Roger Stewart, the former director of education, had once been its head in somewhat turbulent times.
Now, after three years' solid graft, the school believes it is set to move from the bottom 30 performing secondaries in Scotland to the top 150. This is based on class scores and 5-14 results which allow it to predict that, two years from now, 32 per cent of fourth-years will emerge with five or more Standard grade Credit passes. Two years ago, the figure was 9 per cent.
For a school where 28 per cent of pupils are on free meals, the worst ratio among the 11 West Lothian secondaries, this would be a remarkable turnaround.
"Our challenge is that we know what we are capable of," Mr Ford says. "It's our job now to deliver."
So is Mr Ford, former head of Broughton High in Edinburgh where he also wrought some changes, a "superhead"?
Inveralmond has gone through what last September's HMI report delicately described as "a period of instability", which gave it a dismal reputation in the area and a spell in the glare of all the wrong kind of headlines.
Staff and pupil morale suffered, as inspectors found. It was far from being a virtuous circle.
The school also had to contend with factors over which it has little control. The Craigshill and Ladywell communities in its catchment are among the poorest in Scotland and there has been a disquieting level of violence and local feuds. In a recent survey, Craigshill emerged as the ninth most deprived of 1,222 council wards in Scotland and Ladywell 69th.
This is too much, even for a superhead. But Mr Ford can at least exert control over his staff and pupils - and, he repeatedly says, the assistance of his education authority has been essential.
He began with considerable staffing changes. A few "moved on", as he put it - there have been 22 staff changes in the past three years. Others were given room to shine (including a probationer who got all of the top set in a poor year group to achieve good Standard grade results). The school adopted the so-called "McCrone structure" of seven curriculum principal teachers, five dealing with learning and teaching and two with pupil support.
Mr Ford comments: "It is essential for me to have monitoring of learning and teaching and to ensure there is sharing of good practice, which is key to improving learning and teaching. It's also about accountability."
One of the consequences is that there is regular class observation of teachers at work, once a session by a line manager and twice by others who can be peer teachers. This often controversial process is supervised by the seven PTs curriculum - one of whom, by accident or design, happens to be John Wood, Educational Institute of Scotland rep at the school.
As for the pupils, Mr Ford and his staff deployed a range of measures which have almost become part of the textbook for such cases. Achievement was talked up and celebrated, a prefect system was established, the school went all-uniform, a citizenship programme was introduced so S5-S6 pupils could work in the community (and, equally important, the community had a chance to see pupils in a good light), inter-house competitions were organised with Ethicon, a local employer, persuaded to put up a shield.
The school has cracked down hard on latecoming, which could involve as many as 100 pupils out of 900; the figure has been cut to around 30. This is also part of the strategy of improving the school's image in Livingston where more youngsters are in school when they should be, not hanging around the streets.
But the most important task Mr Ford faced was to stem the drift of the best pupils away from the school, and so eventually boost attainment - still the school's "most challenging issue", as its own Standards and Quality report in June acknowledges.
Mr Ford is now able to report a "huge breakthrough" with 236 out of a possible P7 population of 276 opting for Inveralmond. Previously the school was losing half of its potential intake, principally to the neighbouring James Young High and St Margaret's Academy.
The head has worked particularly with the local primaries to achieve this - doubtlessly it helps that his wife is the headteacher of one of them. One move has been to start an "able pupils programme" for P7s leading to "fast track" learning in S1 - which is intended to give pupils an incentive to attend Inveralmond.
"That might sound like academic blackmail," Mr Ford says, "but it's no more blackmail than schools that encourage pupils to come to them because they have good football or rugby teams.
"It may be seen as elitist - but for Inveralmond to be called elitist is quite something. It was not that long ago the Scotsman suggested it was one of Scotland's failing schools."
Course choice for youngsters going into S3 has also been revamped. There are six "tracks" - science, arts, technology, business, sport, health and care, and the contemporary arts. "Courses based on subjects that are linked" is how Mr Ford describes it. English, maths and French feature across all six, for example.
Results are beginning to improve, at Standard grade rather than Higher grade: the proportion achieving Standard grade level 3 in maths has increased from 77 per cent (the worst in West Lothian) to 98 per cent (second equal) in two years. In English, the figure went from 85 per cent (also the worst) to 106 per cent (top of the league).
"We are no longer seen as a sink school," Mr Ford says. The result is that local headlines have been improving. "When I was at Broughton, it was great to hear people say they had a wonderful experience listening to the school's orchestra, or whatever, and that was a marvellous boost for us. So I have said to the staff at Inveralmond that I don't want them ever to be in the situation where people say to them, 'oh no, you don't work at Inveralmond, do you'."
While Mr Ford has certainly taken on a challenge, his ambitions in another sense are modest. "What we are seeking to do is to make the school a social and academic comprehensive, that's all. We are never going to be in the top flight of schools because of our circumstances, but I don't want the odds stacked against us."
Douglas Osler, the former head of the inspectorate, used to say that he was often surprised how quickly a school could be turned around with new leadership and a new direction. The lesson from Inveralmond, according to Mr Ford, is that this may be so but it cannot be done quickly.
"It may even take us five or six years because it probably needs a generation of pupils to make the difference," he says.