Police carrying out door-to-door inquiries stumbled across a cannabis crop in a flat in the Scottish Borders.
A constable noticed the strong smell of the drug from a property as he investigated an unrelated matter.
Officers returned with a search warrant and found £8,000 worth of the drug, 16 cannabis plants, scales, fertilisers, lighting units, bags and thermometers.
David Hamilton, 44, of Magdala Terrace, Galashiels, was jailed for nine months over the find.
At Selkirk Sheriff Court, he admitted charges of cannabis cultivation and being concerned in the supply of the drug in January last year.
However, the Crown accepted it was a non-commercial operation and that he gave the drug to friends and family but did not charge for it.
Hamilton said he had been smoking cannabis since he was 15 and told the court he believed the drug should be legalised.
His lawyer added he decided to grow his own drugs to "keep away from dealers and undesirable people".
Sheriff Kevin Drummond said: "Your views on the matter are noted.
"My job is to apply the law as it is and not as some people might like it to be."
He added that he had no alternative due to the scale of the operation but to impose a custodial sentence.
Source - http://news.bbc.co.uk/1/hi/scotland/south_of_scotland/7826234.stm