Image caption Keir Millar was a leading light in junior stock car racing before his death at a meeting in Fife in 2015

When 11-year-old Keir Millar died following a junior stock car accident, the tight-knit community went into mourning. But four years on, his racing skills remain an inspiration.

Keir, from Lockerbie, was competing in a junior Ministox race in front of family and friends at Lochgelly Raceway in Fife when his mini left the track and struck a barrier. He was taken to hospital but died two days later.

A family member described it as a "freak accident", saying that it was the first Ministox racing death in 40 years.

Ministox is a formula in which 11 to 16 year olds compete in modified minis with extra bars around them to protect drivers during races.

Despite his tender age, Keir had already made a name for himself in stock car racing.

At the time of his death, he was the reigning world Ninja Kart champion - a non-contact go-kart formula for children up to the age of 11. He had also won most of the major titles in Ninja Karts.

As one regular Lochgelly race-goer put it: "Keir was an amazing driver - some of the moves he made on the track were incredible."

Keir's personality also made him a popular figure on and around the racetrack. Shortly after his death, his primary school headteacher said that although Keir was a world champion stock car racer, he was "always encouraging towards others less talented".

What are Ninja Karts?

Media playback is unsupported on your device Media caption Ninja Karts speed around the Lochgelly Raceway

Ninja Karts are similar to go-karts, but with a roll cage and racing aerofoil.

The non-contact junior stock car formula for six to 11-year-olds was introduced in 2013 by Hardie Race Promotions (HRP).

The 50cc vehicles are capable of speeds in excess of 40mph.

Up to 30 drivers take part in races, usually over 12 laps of a short oval track.

There are about 150 registered Ninja Kart racers in the UK, including 40 at Lochgelly.

'I hope I have made Keir smile'

Image caption Bailey Millar recently emulated his late cousin by winning the world Ninja Kart title

Four years on, young stock car racers are drawing inspiration from his achievements.

Among them are his cousin Bailey Millar, who recently emulated Keir's feat of winning the world Ninja Kart championship at Lydden Hill race circuit in Kent.

The 11-year-old, from Coalburn in South Lanarkshire, told his parents shortly after his victory: "I hope I have made Keir smile."

His father Jardine, a former senior stock car competitor, said Bailey and his sister, who has also raced, were determined to keep going after Keir's accident.

"I sat my kids down one night after Keir died and asked if they wanted to carry on racing - and they said 'now more than ever'," he says.

"There's not a night goes by that they are not talking about Keir in the house and they just want to follow in his footsteps."

Image caption There are 150 registered Ninja Kart racers in the UK, according to Hardie Race Promotions

Charlie Hardie, 11, from Polmont, is another young racer looking to follow in Keir's footsteps.

Charlie, who won the world Ninja Karts title last year, said: "Keir inspires me to keep on going and trying to do your best. I look up to him. He was the best."

Image caption Charlie Hardie says Keir Millar "was the best"

Another Lochgelly racer, 11-year-old Rachel Kidd, from Edinburgh, said she too saw Keir as an inspiration.

"Keir has just inspired me to keep going and finish what he's been trying to achieve - to have fun and win as much as you can," she said.

Image caption Rachel Kidd say Keir has inspired her to "keep going"

Having turned 11, Bailey, Charlie and Rachel have now moved up an age level to Ministox, the formula in which Keir lost his life.

At a recent race meeting at Lochgelly, all three said they wanted to progress to senior stock car racing, despite Keir's tragic accident.

They all have the support of their families.

Ahead of one of his last Ninja Kart races before switching to Ministox this month, Bailey said: "I think my mum worries about me all the time.

"I'm not worried because I know I'm wearing a helmet and a harness and stuff so I won't go anywhere."

Charlie said he was excited about moving into Ministox. "The minis are a lot faster," he said. On longer tracks, three-gear cars can reach speeds well in excess of 50mph.

Image caption Up to 30 competitors can take part in a Ninja Kart race

Hardie Race Promotions (HRP), which operates the Lochgelly track in association with Spedeworth Motorsports, hopes the enthusiasm of the sport's youngest competitors will help rejuvenate stock car racing, which is widely seen as having had its best days a generation ago.

In the past few years, several tracks in the UK have closed in the face of rising operational costs.

Racers and their families have also been struggling with higher bills for vehicle maintenance and meeting tighter health and safety regulations.

Lochgelly Raceway organiser Kevin McQueen says: "One of the things we have done is bring in the Ninja Karts formula to try and get youngsters involved in the sport at a young age.

"A lot of them bring friends and family with them to the racing, and hopefully we can get some of them involved as well.

"We often refer to the stock car community as one big family. We'll have on-track rivalries, however when it comes to looking out for each other, we are always there for each other."