The mating of gastropods is a vast and varied topic, because the taxonomic class Gastropoda is very large and diverse, a group comprising sea snails and sea slugs, freshwater snails and land snails and slugs. Gastropods are second only to the class Insecta in terms of total number of species. Some gastropods have separate sexes, others are hermaphroditic. Some hermaphroditic groups have simultaneous hermaphroditism, whereas some sequential hermaphroditism. In addition, numerous very different mating strategies are used within different taxa. This article currently focuses primarily on the mating habits of air-breathing terrestrial slugs. Land slugs can be thought of as land snails that over evolutionary time have either lost the shell completely, have a very reduced external shell, or have retained only internal remnants of a shell. Land slugs are a highly polyphyletic group, which means that many land slug families are not at all closely related to one another. The majority of land slugs are simultaneous hermaphrodites, meaning they possess both male and female reproductive organs that are functional at the same time. Some species regularly self-fertilise. Uniparental reproduction may also occur by apomixis, an asexual process. For the most part, however, land slugs do mate: they find partners, and engage in elaborate courtship rituals before actual sperm transfer takes place. It is common for slugs to mate in a simultaneous reciprocal manner, as occurs in the monophyletic groups Limacoidea and Philomycidae. Limacoidea comprises the family Limacidae (the keelback slugs) and the largest genus of slugs, Deroceras, which contains over 100 known species. Sperm transfer may be external (as in Deroceras) or internal (as in Ariolimax). Sexual strategy When it comes to the mating behaviour of simultaneous hermaphrodites such as pulmonate land snails and pulmonate land slugs, as well as opisthobranch sea snails and opisthobranch sea slugs, there is the question of which sexual role or roles an individual will adopt in a mating encounter. If the individuals involved both have a preference for the same sexual role, then their mating interests are inherently incompatible. Further conflicts arise because a hermaphroditic individual may not necessarily use received sperm; it may use another partner's, or self-fertilise. According to risk-averse models, when this is the case, it would be more prudent for an individual to invest in eggs. However, alternative views state that the male role is preferred, as males benefit more from multiple matings than females do. Neither strategy is