Leeches are segmented parasitic or predatory worms that belong to the phylum Annelida and comprise the subclass Hirudinea. They are closely related to the oligochaetes, which include the earthworms, and like them have soft, muscular, segmented bodies that can lengthen and contract. Both groups are hermaphrodites and have a clitellum, but leeches typically differ from the oligochaetes in having suckers at both ends and in having external annulations that do not correspond with their internal segmentation. The body is relatively solid, and the spacious body cavity found in other annelids, the coelom, is reduced to small channels. The majority of leeches live in freshwater environments, while some species can be found in terrestrial and marine environments. The best-known, such as the medicinal leech, Hirudo medicinalis, are hematophagous, attaching themselves to a host with a sucker and feeding on blood, having first secreted the peptide hirudin to prevent the blood from clotting. A minority of leech species are predatory, mostly preying on small invertebrates.