Is it safe to swim at south of Scotland's beaches?
With the summer holidays in full swing, it's time to head to the coast and have fun by the sea - but is the water clean?
Along the Scottish coastline there are 85 official bathing waters and almost all of them meet strict environmental standards on pollution levels.
However, five breached European safety limits this year - and three of them are in Dumfries and Galloway.
So why are three of the most polluted bathing waters in Scotland within a few miles of each other?
Which bathing waters are the most polluted?
Every year the Scottish Environment Protection Agency (Sepa) rates the quality of Scotland's 85 designated bathing waters either "excellent", "good", "sufficient" or "poor".
The grading is based on regular water quality tests carried out over the previous four years.
Coastal waters at beaches like Achmelvich in the Highlands and Elie in Fife were among 29 rated "excellent" this year, while 30 were "good" and 22 "sufficient".
At the bottom of the league table were three beaches on the Solway coast - Brighouse Bay, Dhoon Bay and Rockcliffe.
Picturesque destinations, they are popular with locals, holiday-makers and day-trippers, but the quality of the bathing water is officially classed as "poor".
A fourth beach - Ayr South - has rated "poor" for four years in a row. If it fails to improve next year, it could lose its bathing water designation.
What is polluting the water?
In a word, poo.
It can be washed into the sea by heavy rainfall from nearby agricultural land.
Dumfries and Galloway's geography puts it at a disadvantage in this respect - not only is average rainfall higher on the west coast, farming is one of its dominant industries.
Gulls - attracted by litter left on beaches - and dog mess can also contribute to the pollution.
But it's not just animal faeces which have been detected in water quality tests - DNA testing of pollution found at Brighouse, the Dhoon and Rockcliffe show that some of it comes from humans.
At Rockcliffe, a Scottish Water septic tank at nearby Kippford is having the most significant adverse impact on the water quality.
The tank was built for about 300 residents, but population growth and the influx of visitors to the area during the tourist season means that "peak population" can be about 1,300.
Scottish Water is drawing up plans for a new waste water treatment works which is expected to be complete in time for the 2023 bathing season.
In the meantime they are using chemicals to reduce the bacteriological content of existing discharge this year - something Sepa expects to be a "more or less instant solution".
Elsewhere some private septic tanks at homes which are not on the main sewerage system are thought to be to blame.
Faecal pollution leads to higher levels of bacteria E. coli and intestinal enterococci, putting swimmers and paddlers at risk from stomach, ear, nose and throat infections.
What is being done to clean up the bathing water?
Sepa has been working with farmers along the Solway coast for almost 10 years in bid to prevent run-off from their land polluting coastal waters.
It can be an expensive and time-consuming endeavour for farmers and landowners - but those who fail to comply with strict rules could face enforcement notices and fines.
They may have to shell out for more slurry storage facilities, fence off entire stretches of rivers or burns to exclude livestock, and install alternative means of providing water for animals.
Farmers are also asked not to spread slurry within 10m (11yds) of any river, burn or open ditch and to delay spreading if heavy rain is expected within 48 hours.
They are urged to check fencing so animals cannot get within 10m of a watercourse, and to check drainage on their steading.
When Sepa first visited the 50-60 farms in the catchment area in 2012 and 2013, about 55% were not complying with rules on controlling pollution.
By spring 2019, all of the farmers had taken remedial measures and were complying with the regulations. Only one enforcement notice had been served.
Calum McPhail, Sepa's environmental quality unit manager (bathing waters), is confident of gradual improvement at The Dhoon and Brighouse Bay.
And he pointed to the improvement of bathing water at nearby Sandyhills - which is now "good" after regularly rating "poor" - as evidence that their strategy works.
He said work with local farmers would continue but there was more work to be done with the community on private septic tanks.
Is it safe to swim at Rockcliffe, Dhoon Bay and Brighouse Bay?
Swimming is not advised in any bathing water in Scotland during, or one to two days after, heavy rain due to the risk of pollution.
But Mr McPhail said that in dry weather water quality was likely to be acceptable even where its official classification is "poor".
The official ratings are based on four years' worth of data but the most up-to-date water quality information is published on the Sepa website.
It regularly tests for the E. coli and intestinal enterococci bacteria at bathing waters across Scotland from 1 June to 15 September.
It also publishes on-the-day bathing water quality predictions for many locations on its website and on electronic boards at beaches.
Mr McPhail said people should consider the information about water quality before going into the sea.
"We're not saying don't go swimming, just giving advice [for swimmers to] make the decision themselves," he said.