Hexapoda consists of all the arthropods with the number of walking legs reduced to six, one pair of antennae, and body segments grouped into three functional tagmata (sections) - head, thorax and abdomen. The head is primarily involved in ingestion, sensory reception and co-ordination. The thorax is usually responsible for locomotion and may bear 0-2 pairs of wings; it consists of three segments, each bearing one pair of legs. In living forms, each walking leg consists of up to six segments and normally ends in two terminal claws. Organs in the abdomen are for digestion, excretion and reproduction. Hexapods are terrestrial or secondarily aquatic, and gas exchange is via tracheae.