After 16 hours of racing around the tight, serpentine track at Formula Kartways in Brampton, Matthew Hayley hit a wall — mentally and almost physically.

“I can tell you for a split second, I considered finding the hardest wall to drive that car into… my brain went to that dark place,” Hayley said.

The East York resident was driving blind after thick tears had formed in his eyes from a combination of lack of sleep and wind from the zooming kart.

Hayley could rely only on muscle memory, but his endurance was almost spent.

Ice packs covered his arms as he struggled to guide his vehicle. His curled fingers stiffened as they clutched the steering wheel.

His neck was limp, swinging helplessly with each cutting corner and hairpin turn. His spine, already warped from his kyphoscoliosis (an unnatural S-curve of the spine), throbbed as the 7.5-horsepower go-kart rumbled.

As Hayley felt his focus slipping away at 4 a.m. on Jan. 23, he thought of his mother, Margaret Hayley, who died of lung cancer six years ago.

She was the reason he was here.

Determined to succeed, Hayley got a second wind. He drove with one hand, using the other to press on his limp right leg until the gas pedal kissed the bottom of the go-kart.

“My mom only had half a lung left and she was still breathing… when I was feeling like giving up in those last couple hours, I reminded myself of the things my mother pushed through,” he said. “It was spiritual. I felt her hand on my shoulder as I was pulling through. I felt a hug, the sun came out, and I was raising my arms up to the light.”

Eight hours later, Hayley stood atop the steering wheel as he finished his final lap, smashing the world record for the longest distance driven in a go-kart in a continuous 24-hour period.

Facts about Hayley’s record • Hayley beat the record around 10:40 a.m. on Jan. 23, but decided to continue until he reached the 24-hour mark.

• He only took breaks when he ran out of fuel, which was every hour and 45 minutes.

• His average lap time was 16.7 seconds and he completed 4,112 laps, a total of 772.48 km.

• Hayley trained four to five days a week for four months, with sessions ranging from one hour to six hours.

• His coach taped three pounds of lead to his helmet and three-pound cuff weights to his arms so they could handle the physical toll of the g-forces from the cutting corners on the course.

He celebrated, but the record — unrecognized by Guinness World Records, as they have no application on file — was an afterthought.

Hayley, 31, said the true triumph was the money raised for charity and his personal transformation.

“The record was nice, but as soon as we were talking charity, I was in full-tilt,” he said.

Hayley’s goal was to raise $5,000 to support the place where his mother stayed, the Princess Margaret Cancer Centre.

He surpassed the target, amassing $5,135.

“Growing up, I was an under-motivated under-achiever. A lot of my life leading up to this has been a lacking in drive. That’s where I really said enough is enough, and I approached this.”

Hayley started go-karting over a decade ago and was instantly enamoured.

Impressed by Hayley’s performance at the time, Shaun de Jager, the coach and manager at the track, said with practice Hayley could consider driving in their competitive league and events, but he didn’t accept the offer.

After his mother’s death, depression set in, leading to a medical leave from work.

“When I lost mum, I hit the denial stage very hard,” Hayley said. “A year ago, I spoke to my doctor, he agreed and said, ‘Let’s call it a pre-emptive medical leave.’ When I say pre-emptive, I mean before I took care of myself, if you will.”

Searching for answers and medical help, he reverted to a psychological approach to try to rebuild himself. Through this, he revisited go-karting.

“Those that are in depression but still appear functional… are so underseen and left behind,” he said. “I ended up turning to someone private… I modeled after play therapy.”

Play therapy is an approach where people, usually children, use play to communicate and express emotion.

“I realized when I was out on the track it was a free place of thought.” —Matthew Hayley

Hayley returned to the track and found healing in the hobby.

Then, while rummaging through his attic one day, something caught his eye. He dusted off the 2000 edition of the Guinness Book of World Records and looked at the indoor go-karting record.

After crunching some of his own racing statistics, Hayley had an epiphany.

He told de Jager about his idea to break the record. Three days later, he completed a six-hour trial run.

“When he told me about the record, I was interested, but I wasn’t sure it could be done,” de Jager said. “The more I ran the numbers, the more I realized how insane it was. The numbers worked out, but only assuming the driver was a robot.”

Hayley points to his coach, his public relations manager, his chief medical officer, his girlfriend, his father, step-mother and his late mother as pivotal players in his success.

Although he achieved everything he set out to do, “This is only the beginning,” he said.

Hayley and his team plan on beating the outdoor version of the same record this summer, with a larger-scale event.

“The unofficial date is June. I want to invite sponsors, local crafters and maybe some racers. People can come by and make a donation,” he said. “We did great with the $5,000. We smashed it. So, let’s add a zero.”

De Jager said Hayley will use the same go-kart for the outdoor attempt, but with modifications.

“We’ll probably strip off the bumpers and the roll bars and add a 10-horsepower engine so it’ll be 50 pounds lighter and he can hit the 100-km speeds,” he said. “Matthew will have to cover 2,000 kilometres in 24 hours.”

Hayley aims to do more than set records.

He grew up with learning disabilities, and succeeding in school was difficult. Because of that, he hopes to explore philanthropy, speak at schools and create opportunities within schools for students with learning disabilities.

“I’ve almost learned an appreciation for depression. The next time it starts coming to find me, I’m going to welcome it with open arms,” he said. “I won’t ever see it as depression, but contrast to appreciate the rest that’s in my life. That’s what I’ve really learned from this journey, and that’s the message I want to get out there.”