By Katie Walderman
BBC North West
An eight-year-old girl from Cheshire has become the first child in the world to have pioneering brain surgery aimed at easing her dystonic cerebral palsy.
Dystonia is a lifelong neurological condition which can cause uncontrolled and painful muscle cramps and spasms.
Surgeons at Alder Hey Children's Hospital in Liverpool performed a new form of advanced deep brain stimulation (DBS) on Hayley in January.
They hope it will reduce Hayley's pain levels and help her to communicate.
Her four-hour operation saw surgeons insert tiny electrodes - as small as a grain of rice - into the part of Hayley's brain that is responsible for movement.
They are connected by a wire under the skin to a specially-implanted battery.
Electrical pulses to modify the signals causing the symptoms of dystonia are sent back automatically.
The electrodes can then send back signals from Hayley's brain, which can be analysed in real-time, to see how the stimulation is working.
What is dystonia?
Dystonia is the name for uncontrolled and sometimes painful muscle spasms. It is usually a lifelong problem, but treatment can help relieve the symptoms.
It can start at any age and can affect the whole body or only one part of it.
- uncontrolled muscle cramps and spasms
- parts of your body twisting into unusual positions - such as your neck being twisted to the side or your feet turning inwards
- shaking (tremors)
- uncontrolled blinking
The symptoms may be continuous or come and go. They may be triggered by stress or certain activities.
Consultant neurosurgeon Jonathan Ellenbogen said: "The new BrainSense technology developed by Medtronic captures brain activity data direct from the leads implanted into the patient's brain.
"This helps us to accurately detect and analyse the brain signals that are causing the dystonia. We can access this data and adjust the deep brain stimulation settings -personalising the therapy for the best possible outcome.
"This is a huge step forward and something we couldn't do before. This is also particularly important in patients who are non-verbal, like Hayley."
Hayley, from Nantwich, was born at just 24 weeks old and her uncontrolled movements make communication all but impossible.
"It's hard when she can't tell us what's wrong with her," her father Gareth said.
"She can't tell us when she's in pain, when her dystonia's really bad. Whether she's got a tummy ache or an earache. So it's really hard to help her.
"She can't do Makaton or sign language because of the erratic movements. So the only other real option is to do Eye Gaze. So your eyes look at a screen and form words.
"But that's difficult at the moment because of Hayley's head control. So if we could get some really good head control for Hayley, we could use Eye Gaze. That's what I really hope."
Mr Ellenbogen said: "DBS isn't suitable for all patients with dystonia, but for some children and young people it can be life-changing."
The device is switched on a couple of weeks after the operation. Although results aren't instantaneous, it's hoped patients see an improvement within a few months.
DBS technology is often used for patients with another neurological condition - Parkinson's disease.
But Hayley's mother Emma said: "With Parkinson's patients, typically they develop it in later in life, so when they turn their machine on, they already have the control and their brain already knows what to do.
"Whereas Hayley has never had that control, to learn how to do something."
The initial signs for Hayley, though, are positive.
Mr Ellenbogen said: "Hayley already looks more settled than she did when she came into clinic. So hopefully she'll go from strength to strength. The start of a hopefully a brighter future for Hayley and other patients like her."
While many months of trial and error lie ahead to find the right level of stimulation for Hayley, Emma also noticed a marked improvement in her daughter.
"Now we can sit on the sofa with her a lot better," she said. "She can enjoy things a lot better. She's easier to feed, she sleeps a lot better, she doesn't get half as irritable. She's a lot happier. "
Why not follow BBC Merseyside on Facebook, X and Instagram? You can also send story ideas to northwest.newsonline@bbc.co.uk