Taking a headache pill gave George Greer the inspiration to develop a type of poo bag that dissolves in water.
He had been out for a walk at a Scottish loch days before, and had been shocked at how many plastic dog waste bags had washed up on to its banks. Pvc Film
That got the 49-year-old trying to think of a solution to the problem.
Then the headache medicine started him wondering how the dissolving part of the tablet worked - and if he could use the same material in bags.
Mr Greer, who lives in Edinburgh, said he had felt "shocked" for days after seeing the mess while walking at Loch Long in Argyll with his four-year-old Swiss Shepherd, Noah.
"It was really bothering me and then a few days later when I was taking a dissolving headache pill I had the idea."
He discovered that the material, which coated the pills, had been invented in the 1920s. He then tracked down a manufacturer in China.
He asked his friend, Ka Ho Wong, an archaeologist who could speak Cantonese, to liaise with the supplier to see if he could buy the material - and if it could be turned into poo bags.
After 12 months, the poo bags had been created and the prototype had been made.
The two men started up Project Harmless, and Mr Greer has now given up his job as a product designer to run the company.
They started selling the bags in April on the website and have partnered up with the Edinburgh Dog and Cat Home and American Express. Project Harmless has now been working with some big department stores in England.
Derek Stewart-Brown, of the Edinburgh Dog and Cat Home, said: "We try to be as environmentally aware as possible and anything we can do to reduce our waste is important to us.
"I think this is a wonderful Scottish innovation and we are delighted to support it."
Environmental activist Laura Young said she had looked into the product and thought the Project Harmless bags were the most sustainable on the market.
"Brands of dog poo bags that are compostable or biodegradable in one way are better than plastic bags because they don't use fossil fuel products," she said.
"However, these bags need really specific conditions to breakdown as intended.
"In theory they (the other bags) should work but in practice they're not quite there."
The Project Harmless bags cost more than other products, being sold at £15.50 for 100 bags.
The cheapest poo bags in supermarkets cost about £1.50 for 100. Mr Greer said these often say they are degradable, but this process takes about 500 years.
Mr Greer said: "Some people say they are expensive, but cheap bags are evil for the planet. The government should be banning them.
"Poo bags come at a cost because they devastate the earth."
He said that biodegradable ones need light and oxygen to degrade, which they do not get if they are sent to landfill.
And he said plant-based compostable bags would only break down in very specific conditions.
"They are often marketed as the most eco option, but if they are not disposed of properly and instead sent to landfill from a normal bin, then they don't have the heat or nitrogen to break them down," he said.
Mr Greer said this meant that they took decades to break down, while also giving off methane - a key driver of global warming.
His bags are made from non-toxic and microplastic-free material, and are water-reactive rather than water-resistant.
The liquid in poo causes the bag to lose its structural integrity, and they also disintegrate if they end up in rivers or the sea.
It is not recommended to flush them down the toilet, as they initially remain intact for several days in cold water.
The bags dissolve more quickly in warm water, but are designed to be robust enough to be left in a bin for several days.
However, after about six days they would start to disintegrate.
"There is a lot of government action to stop shopping bags, which can be recycled, but you can't recycle a poo bag," added Mr Greer.
"This is really exciting and I really believe in it.
"We are told now not to use plastic shopping bags just once at the supermarket, but nobody talks about dog poo bags and the effect of them on the environment."
Walkers pick up 80 dog poos in 90 minutes in town
No way! Litter picker finds 102 dog poo bags on one walk
Dog poo forms a significant part of foxes' diet
Dunfermline Winter Festival 2022: Christmas carols, drag queens, big band and jazz
Edinburgh Weather: Hour by hour forecast for Thursday as snow falls amid weather warning
Traders in four towns team up to object to town centre parking charges
Sussexes address royal race row in Netflix documentary series
Haddington West Church becoming 'warm hub' for those struggling
Concerns growing for missing Edinburgh 14-year-old last seen two days ago
Iran carries out first execution over protests
I'm really proud my children are mixed race, says Harry
Chinese pour hearts out on hero doctor's page
Indonesia reform concerns go beyond 'sex ban'
Pitfalls lie ahead as China exits zero-Covid
Hope and worry as Beijing relaxes zero-Covid policy. Video Hope and worry as Beijing relaxes zero-Covid policy
Sri Lanka's children go hungry as food prices soar
‘Doctors fitted a contraceptive coil without my consent’
Chinese pour hearts out on hero doctor's page
Where do Harry and Meghan get their money?
Should countries try to do everything themselves?
‘I’ve been spat at in the face for the colour of my skin’
Zimbabwe's stunning 80km safari train
The misery of middle managers
The love song that became an anthem
Material Release Film © 2022 BBC. The BBC is not responsible for the content of external sites. Read about our approach to external linking.