Braemar Castle has everything most 10-year-olds would want from a castle - turrets, dungeons and ghosts. In a wonderful setting surrounded by snow-clad peaks in the heart of the Cairngorm National Park, this is the only castle in Scotland run by the community.
For the past five years, it has been operated by local people on a 50-year improving lease from Invercauld Estate. This morning, local schoolchildren are taking full advantage of this privilege, chasing each other across the grassy slopes in the castle grounds.
"There's lots to do and it's fun and it's got good scenery. If you come out here, you can see lots of trees and rivers and the hills," says nine- year-old Katie Strachan from Braemar Primary.
The 17th-century castle has had an eventful 400-year history and offers a dramatic location and colourful characters to inspire children's curiosity and creativity.
The 1715 Jacobite Rebellion started in Braemar, but after the `45 rebellion the castle was the garrison for government troops, who enforced a new law to suppress the rebels, banning weapons and the wearing of tartan.
As well as its links with three Jacobite uprisings, the castle is the seat of Clan Farquharson and during Queen Victoria's reign was furnished as a family home, which she visited for afternoon tea.
There is also a room here dedicated to Robert Louis Stevenson, who wrote the first chapter of Treasure Island while on holiday in Braemar.
Today the castle has a welcoming, homely feel - no roped-off areas or snooty officials watching children's every move and bringing their teachers out in a cold sweat. The community aims to share their fascination with this magical place, allowing children to explore without unnecessary constraints.
Wide-eyed six-year-olds from nearby Ballater Primary are taking their first faltering steps up the winding stone staircase into Scotland's past with the help of guide Doreen Wood. "This castle was the family home of the Farquharsons of Invercauld for 200 years," she tells the class of P23 pupils. You can sense that local volunteers who guide visitors around are excited about the history of this place when they tell its story - probably because it's also their story.
Mrs Wood's mother was a cook in the castle and there is an old black-and- white photograph of her grandfather on the wall here, showing him loading ice for the castle on to a horse-drawn sleigh.
For younger children such as these, who may struggle with the intricacies of the Jacobite uprisings, there is a hunt for tiny teddy bears hidden in unexpected places as they tour the castle.
These children are doing a project on castles and several pupils come from families who work at Balmoral Castle a few miles down the road.
"My grandma works for the Queen at Balmoral Castle and we live at Crathie," says one of the girls.
"And my dad works at Balmoral and he's a gamekeeper," says one of the boys.
Their teacher, Helen Stodter, says this visit will be used for learning across the curriculum. "We're using it for everything - we do technology, language and history. We're going to make weapons and catapults and we've been building castles," she adds.
Primary and secondary schools have their visits tailored to suit particular projects or periods of history and the castle has developed suggested activities for children of all ages in line with Curriculum for Excellence.
Today's guide, Mrs Wood's husband, Brian, is also a volunteer and, as a retired headteacher of Hazlehead Academy, designed the castle's CfE strategy, with ideas across a range of subjects that teachers can use with pupils.
Adults are also involved in research here to develop information for visitors. "The volunteer guides who work here need to find out about the castle themselves, so there is a training programme for them. They also do their own reading and research over the winter time and come up with new stories to tell - so the whole thing becomes more enriched every year," he says.
Mr Wood is also deputy convener of the Cairngorm National Park, which has funded training for volunteer guides and supported an exhibition that was launched at the castle by Aboyne Academy pupils in June.
"One of the aims of the Cairngorm National Park is to preserve, conserve and enhance the natural and cultural heritage of the park, and this is a prime example of our cultural heritage," he says. "So the national park is actively involved in supporting the work that goes on here."
The castle's connections with the Jacobites provide a focal point for interested historians - Braemar had a key role in the 1715 rebellion.
"It was started here in the village of Braemar by the 6th Earl of Mar, who used Braemar Castle as his hunting lodge, and by his neighbour, Farquharson of Invercauld. So together they raised the standard in the middle of the village that signified the start of the 1715 rebellion," Mr Wood says.
All of this is within walking distance of Braemar Primary, where children have been learning about their historical heritage and about the community's fundraising campaign.
"The castle desperately needs a new roof and the cost is enormous. Historic Scotland wants the slates to be from the same quarry as the original slates," says Marilyn Baker, a retired teacher who volunteers as a guide.
Mrs Baker is a supply teacher at Braemar Primary and has been working with pupils on a project about slate, which used to be quarried locally.
The children visited one of the quarrying areas and learned more about slate and local geology from a geologist there. "We had a little chisel and we broke open rocks so we could see if there was slate inside it," says Fraser Wood from P6.
Pupils have kept a journal about what they have done and they are going to give a presentation to the local history society once they have finished their work.
"They were the only children ever allowed to go into the dungeons and up to the top floor where all the damage is. They were able to see for themselves the damage done to the castle by the missing slates," says Mrs Baker.
Fraser thinks the castle is amazing. "But because there's no new slates, it's started to leak a bit in the top storeys, but the bottom storeys are still pretty good," he says.
Mrs Baker has recently become a published author of children's fiction and has been impressed at the work produced by these pupils, following visits here.
"The children wrote fantastic stories when they went back to the class. I said to them: `Imagine you were really punished for something. What was it you did? Did you steal a cow or say something bad about the minister? Why were you in the dungeon? Who put you there? What was it like and how did you get out?'"
Fraser says visiting the dungeon was a highlight. "We were put down to see what it would be like staying down there. They switched the lights out and it was pretty scary."
He is a triplet and one of his brothers, Angus, has written a vivid fictional account of a young Jacobite soldier locked up in the dungeon. "Two redcoats stood, their muskets pointing at my chest. Two hours later I was in the pit in Braemar Castle. It was dark, but luckily the floor had been cleared of all the muck and bones.
"It was quite a way down to the bottom. I had managed to smuggle my pistol and its powder and shot. The two soldiers said I was going to be shot. I felt very sad. The guards shut the trap door and then there was silence. That's when I had the idea of escaping."
The castle has also become popular with Scottish secondary schools, including nearby Aboyne Academy, whose pupils are staging an exhibition there about the abandoned township of Auchtavan, in the hills near Braemar.
The whole of the school's first year embarked on this research venture nearly two years ago as part of a transition project begun in primary.
"Pupils had an Introduction to Archaeology workshop in primary school as a transition project before they came to the academy," says Michael Foy, principal teacher of humanities.
"Then all the pupils visited the site at Auchtavan in September 2010 and spent two periods a week for the rest of that session researching all aspects of life in the lost community."
The legacy of their investigations is a permanent exhibition that shares their findings with their community and international visitors to the castle.
`You can still hear the dead baby crying at night'
No castle would be complete without its ghosts and Braemar sounds like a busy place after dark, with a cast of abandoned lovers, wailing babies, mystery pipers and rebel John Farquharson of Inverey, known as the Black Colonel.
Braemar pupil Cameron Lawrence, 10, thinks this castle would be a very spooky place at night. "I've heard a lot of stories about it. There was a story about this little baby and the soldier couldn't get to sleep because it was crying out all night in one of the rooms. So he threw the baby out of the window and it landed on the ground. You can still hear the baby crying at night," he says.
Cameron and his classmates have also watched volunteers at work here and heard about their fundraising to repair and maintain the castle. "I think this brings real life into the classroom," says his teacher Marilyn Baker.
"It's not just sitting at a desk and looking at a book. They've got bricks and mortar to look at and a real-life problem the village is facing with the castle."
Fortunately, it is not all about problems. This castle has been known as a good place for a party throughout most of its history - a tradition villagers are happy to uphold.
On 29 July, they stage their annual Jacobite Festival when everyone dresses up in costume and hundreds of visitors join the celebrations. "I usually come to that," says nine-year-old Katie Strachan from Braemar Primary, already a discerning partygoer.