YORK, Maine (NEWS CENTER) -- Contaminated water can be a pricey problem to diagnose and solve, if you rely on humans to do it.

A few towns in southern Maine are taking advantage of a program that uses dogs to detect waste in water.

The dogs are charged with the job of sniffing out human waste in public water sources. They come from a company in Michigan and are hired by cities and towns around the country to find the sources of contamination, like septic system failures and sewage leaks. Tuesday, the dogs were investigating samples of water from a stream in Ogunquit.

"Towns spend a lot of money every year, especially beach communities, trying to figure out where their bacteria sources are coming from to keep their beaches clean and to keep them from closing," Emily DiFranco of FB Environmental told NEWS CENTER. "Using the dogs is a very cost effective, quick way to really rule out specific sources."

The dogs are also visiting Kittery this week, as well as five cities and towns in New Hampshire.