Tudor Cobalas nearly crashed his car while driving and texting on his phone.
It was this near-death experience that inspired him to turn the smartphone from a weapon of mass distraction into a tool for safer driving.
Mr Cobalas, 30, from Romania, developed SafeDrive, an app that rewards drivers for ignoring their phones while driving.
Once a driver exceeds 6mph (10kmh), the app launches a "Release" button on the screen, effectively locking the phone. Driving without checking the phone generates points that can be converted into shopping discounts in the SafeDrive Marketplace.
Pressing the Release button while driving wipes out the points earned during that journey.
It's a simple idea that has attracted nearly 100,000 users globally and 30 commercial partners, from insurance companies to retailers.
Mr Cobalas has also developed an app, Milez, aimed at teenage drivers.
"It was a response to questions from parents in the US who wanted to educate their children, young drivers," he says.
Again, the idea is simple - teenage drivers are financially rewarded by relatives and friends through the Milez app if they drive safely.
Mr Cobalas's native Romania has a particularly poor record when it comes to road fatalities.
In the European Union as a whole, the average number of road deaths per million inhabitants is 51.5. In Romania, it is nearly double that figure at 95.
Worldwide, about 1.25 million people die each year as a result of road traffic accidents, according to the World Health Organization (WHO).
"Smartphone distraction" is blamed for an increasing number of accidents. Drivers using a mobile phone are four times more likely to be involved in a crash, the WHO says.
That is why a growing number of technology entrepreneurs are trying to tackle the problem.
"Although smartphones are rightly blamed for an increase in distracted driving, we wanted to show that smartphones could be used to make drivers better," says Hari Balakrishnan, chief technology officer of Cambridge Mobile Telematics, a US company that has developed an app called DriveWell.
The app measures all aspects of driving such as hard braking, abrupt acceleration, sharp cornering and speeding.
But it also monitors how often drivers are distracted by their phones and generates a "safety score" at the end of each trip.
The company emerged from a project at the Massachusetts Institute of Technology run by Mr Balakrishnan and co-founder Sam Madden.
The free app features competition leader boards that enable drivers to compete with their friends, family and colleagues, as well as personalised safer driving tips.
Good safety scores can earn drivers discounts on their car insurance with some insurers, Mr Balakrishnan says.
Last year the company launched a competition to find Boston's safest driver. Nearly 5,000 people have signed up, and 98 have been awarded more than $3,400 in prizes.
Data from 40,000 DriveWell app users around the world demonstrate its effectiveness, says Mr Madden.
"By day 30, we see a 35% reduction in phone use and a 20% reduction in the number of hard braking events," he says