Converted htr_dc into function