Inventing the first app in the world to be approved as a contraceptive started as a hobby project for Elina Berglund Scherwitzl.
The nuclear physicist, who'd been working on the team that discovered the Higgs boson, was tired of using hormonal contraception but wasn't ready to have a baby.
So the Swede set about using her data skills to find an alternative.
"Like many women I had tried many different contraception options since my teenage years and hadn't really found a solution that fit me," she explains.
It was in my quest for an effective natural alternative that I discovered that you can see when you're fertile by your temperature, and for me that was really a revelation.
Using complex mathematics and data analysis, Mrs Berglund Scherwitzl began developing an algorithm designed to be so precise it could pinpoint exactly when in her cycle she would ovulate.
This enabled her to map out the days when she would need to use protection, to a much higher degree of certainty than similar "rhythm" or natural planning methods.
She was so pleased with the results that, together with her Austrian husband, fellow physicist Raoul Scherwitzl, she set about founding her own business called Natural Cycles.
It offers an app designed to help women around the world with their fertility and contraception needs, by allowing them to collect their own temperature data sets and closely monitor their cycle trends.
Launched in 2014, it now has some 300,000 users, who pay a monthly or annual fee for the service. In the UK a yearly deal costs ВЈ50, which includes the cost of a thermometer.
The company has attracted $8m (ВЈ6.1m) in investment and has so far made sales of more than $6m.
However, if it wasn't for the timing of another large scientific discovery, the project may not have got off the ground so quickly.
Mrs Berglund Scherwitzl, who was raised in Malmo in southern Sweden, had been working at Cern, the Geneva-based European Organization for Nuclear Research. In 2012, after decades of research, the team she was part of finally found the Higgs boson particle, crucial to our understanding of how the universe works.
A lot is about coincidence and also timing. We had just got married. The experiment was shutting down for a couple of years and I was thinking, 'If I would ever try something outside of physics, now would be the time'.
My husband had always wanted to become an entrepreneur, so he suggested, 'Okay let's leave physics and make this algorithm into an app'.
Following several medical trials, their app became the first tech-based device on the planet to be formally certified for use as contraception, in February 2017.
It gained approval for use across the EU after getting the green light from the German inspection and certification organisation Tuv Sud.
Yet the journey from launch to European certification was "a rollercoaster", she says.
An initial approval from the Swedish Medicinal Products Agency was revoked in 2015, amid headlines about the app encouraging risky behaviour among young women in her home country, where the couple had returned to develop their business.
The company was banned from marketing the app for 18 months, resulting in "a big bump in the road" for the growth of the firm.
"Since I came from the scientific angle I thought that if I just create a product that's really good, it will sell itself and everyone will trust it. I realise that that's not at all the case," she admits.
But it was maybe good that I was so naive, because if I would have known all the challenges ahead, maybe I wouldn't have dared to do it.
The start-up now markets itself as being "as effective as the pill", following one of the largest clinical studies in contraception involving more than 4,000 women, published in the peer-reviewed European Journal of Contraception and Reproductive Health Care.
The researchers - which included the co-founding couple - found that 7% of women who used the app in a "typical" way (allowing for some human error) got pregnant, compared to 9% taking the pill and less than 1% using IUD coils.
Against this background, Mrs Berglund Scherwitzl accepts that her product relies on women sticking closely to the app's instructions and therefore might not be for everyone, not least because it also fails to protect its users from sexually transmitted diseases.
"Just like the pill we need some effort from the user on a daily basis. But we really hope to be the default alternative if you don't want to use hormonal contraception or IUDs," she argues.
While the product is only currently certified in the EU, where its users are concentrated in the UK and the Nordics, it is available worldwide and, despite its earlier controversies has attracted users in some 160 countries.
Mrs Berglund Scherwitzl says that global sales have already shot up since its EU certification was confirmed in February, with the firm already more than doubling last year's turnover of $2m.
Alongside expanding its subscription base of women seeking to avoid getting pregnant, the company is also trying to attract more customers using the app from a family planning perspective - to work out when is the best time to conceive.
Continuing to build their company - which now has 30 employees based in Stockholm - while also caring for a young child has not been easy, she says. However it has guaranteed they spend plenty of time together.
It's our passion and our hobby. At night when we come home and have a glass of wine we talk about our goals and we become a bit more visionary than we have time to do during the work day.
That vision involves raising awareness of how technology can be used to tackle issues linked to women's health, something which she says has been "largely ignored because researchers are often men".
The pair also hope to increase the number of the app's users in developing countries and nations where religion is a barrier to contraception.
"We've come even further than I first hoped, and that's an amazing feeling. But I feel like we should not stop here, she says.
Now is really the time to grow and reach all these women in the world... Every pregnancy should bring happiness.