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 onto its banks.
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."