The grey, forbidding walls of Ruthin Gaol have become the spooky nerve centre for an innovative project to bring the town's history to life.
The aim of the 20 A-level students from Brynhyfryd high school, in Ruthin, is to make family squabbles over map reading a thing of the past.
Instead, they are working on inventing hand-held digital maps which automatically guide users to places of historic interest.
The mobile computers, called PDAs, also provide detailed information on sites of interest and are programmed to bleep at destinations where ghostly happenings have been reported. There are four themes to an updated version of the e-heritage trail this year, comprising ghosts, historic buildings, pubs and the town's oldest, and apparently haunted, house.
All the students are part of the pilot Welsh bac. Brynhyfryd co-ordinator Linda Cooledge said working on the e-trail had brought them into the real world of work.
She said: "The students also cover the key skills of IT, problem-solving, communication and improving their own learning and performance.
"So many young people today achieve exam A grades, and this sort of project gives them something extra."
Sixteen-year-old Aiden Giles, who is also taking history, IT and media A-levels, said: "I'm enjoying the IT side and working with the computers with the help of my teacher."
Aimie Holden, 16, and Siwan Owen, 17, are also studying for history A-levels. Aimie said: "I'm doing the ghosts of Ruthin trail, starting by researching ghosts at the jail." Siwan, meanwhile, is upgrading the original trail.
The project, supported by the Key Skills Support Programme Cymru, should be available for public use in September 2006.
In all, 31 schools and colleges across Wales are signed up for the pilot.