A Dundee man caught with heroin worth more than £56,000 has been jailed for seven years.
A court was told Dennis Duffy had returned to the drugs trade following his early release from prison for dealing diazepam.
Duffy, 45, also has previous convictions for supplying heroin.
The High Court in Edinburgh heard that police acting on a tip-off raided a house in Dundee's Mains Loan on 2 December last year.
Officers found Duffy in the living room with £583 in the pocket of his shorts.
Various packages containing a total of 311g of heroin were recovered from the house, as well as five mobile phones and sets of scales.
Duffy had left a thumb print on a bag containing the largest quantity of heroin found during the search.
Duffy admitted being concerned in the supply of heroin.
Defence counsel Ronnie Renucci said Duffy was drug free when he last left prison but did not have support at the time.
He returned to using heroin and accumulated a drug debt.
Mr Renucci said Duffy had allowed the house to be used for storing drugs in return for the debt being written off and to get drugs for his own use.
Mr Renucci said: "He recognises now this really is the last chance.
"I understand he is going to try and ensure that when he comes out he will receive professional help and guidance."
Judge John Morris QC told Duffy: "As you know yourself, this is a vile trade."