Vestigiality
Vestigiality describes homologous characters of organisms which have lost all or most of their original function in a species through evolution. These may take various forms such as anatomical structures, behaviors and biochemical pathways. Some of these disappear early in embryonic development, but others are retained in adulthood. All such characters can in turn can be traced to the genes which code for such characters. Some genes no longer code for anything, and can thus be said vestigial themselves, or junk DNA.
Vestigial structures are often called vestigial organs, although many of them are not actually organs. These are typically in a degenerate, atrophied, or rudimentary condition, and tend to be much more variable than similar parts. Although structures usually called "vestigial" are largely or entirely functionless, a vestigial structure may retain lesser functions or develop minor new ones.  However, care must be taken not to apply the label of vestigiality to exaptations, in which a structure originally used for one purpose is modified for a new one.  For example, the wings of penguin would not be vestigial, as they have been modified for a substantial new purpose (underwater locomotion), while those of an emu would be, as they have no major purpose anymore (not even for display as in ostriches).
Vestigial characters range on a continuum from detrimental through neutral to marginally useful. Some may be of some limited utility to an organism but still degenerate over time; the important point is not that they are without utility, but that they do not confer a significant enough advantage in terms of fitness to avoid the random force of disorder that is mutation. It is difficult however to say that a vestigial character is detrimental to the organism in the long term - the future is unpredictable, and that which is of no use in the present may develop into something useful in the future. Vestigiality is one of several lines of evidence for biological evolution.

# History
Vestigial structures have been noticed since ancient times, and the reason for their existence was long speculated upon before Darwinian evolution provided a widely-accepted explanation. In the 4th century BC, Aristotle was one of the earliest writers to comment, in his History of Animals, on the vestigial eyes of moles, calling them "stunted in development". However, only in recent centuries have anatomical vestiges become a subject of serious study. In 1798, Etienne Geoffroy Saint-Hilaire noted on vestigial structures:
His colleague, Jean-Baptiste Lamarck, named a number of vestigial structures in his 1809 book Philosophie Zoologique. Lamarck noted "Olivier's Spalax, which lives underground like the mole, and is apparently exposed to daylight even less than the mole, has altogether lost the use of sight: so that it shows nothing more than vestiges of this organ."
Charles Darwin was very familiar with the concept of vestigial structures, though the term for them did not yet exist. He listed a number of them in The Descent of Man, including the muscles of the ear, wisdom teeth, the appendix, the tail bone, body hair, and the semilunar fold in the corner of the eye. Darwin also noted, in The Origin of Species, that a vestigial structure could be useless for its primary function, but still retain secondary anatomical roles: "An organ serving for two purposes, may become rudimentary or utterly aborted for one, even the more important purpose, and remain perfectly efficient for the other.... n organ may become rudimentary for its proper purpose, and be used for a distinct object."
Darwin however still often refers to the 'use and disuse' of structures having some role in heredity, with inheritance of acquired characters being treated as an important aspect besides the central force of natural selection. In the final chapter of The Origin of Species he describes the process: "This has been effected chiefly through the natural selection of numerous successive, slight, favourable variations; aided in an important manner by the inherited effects of the use and disuse of parts".
In 1893, Robert Wiedersheim published a list of 86 human organs that had, in his words, "lost their original physiological significance". Theorizing that they were vestiges of evolution, he called them "vestigial". Since his time, the function of some of these structures has been discovered, while other anatomical vestiges have been unearthed, making the list primarily of interest as a record of the knowledge of human anatomy at the time. Later versions of Wiedersheim's list were expanded to as many as 180 human "vestigial organs". This is why the zoologist Newman stated in the Scopes Monkey Trial that "There are, according to Wiedersheim, no less than 180 vestigial structures in the human body, sufficient to make of a man a veritable walking museum of antiquities."

# Common descent and evolutionary history
Vestigial structures are often homologous to structures that are functioning normally in other species. Therefore, vestigial structures can be considered evidence for evolution, the process by which beneficial heritable traits arise in populations over an extended period of time. The existence of vestigial traits can be attributed to changes in the environment and behavior patterns of the organism in question. As the function of the trait is no longer beneficial for survival, the likelihood that future offspring will inherit the "normal" form of it decreases. In some cases the structure becomes detrimental to the organism (for example the eyes of a mole can become infected). In many cases the structure is of no direct harm, yet all structures require extra energy in terms of development, maintenance, and weight, and are also a risk in terms of disease (e.g. infection, cancer), providing some selective pressure for the removal of parts that do not contribute to an organism's fitness. A structure that is not harmful will obviously take longer to be 'phased out' than one that is.  However, some vestigial structures may persist due to limitations in development, such that complete loss of the structure could not occur without major alterations of the organism's developmental pattern, and such alterations would likely produce numerous negative side-effects. The toes of many animals such as horses, who stand on a single toe, are still evident in a vestigial form and may become evident, although rarely, from time to time in individuals.
The vestigial versions of the structure can be compared to the original version of the structure in other species in order to determine the homology of a vestigial structure. Homologous structures indicate common ancestry with those organisms that have a functional version of the structure.
Vestigial traits are still considered adaptations. This is because an adaptation is defined as a trait that has been favored by natural selection. Adaptations therefore need not be adaptive, as long as they were at some point. 

# Examples

## Animals
In whales and other cetaceans, one can find small vestigial leg bones deeply buried within the back of the body. These are remnants of their land-living ancestors' legs. Many whales also have undeveloped, unused, pelvis bones in the anterior part of their torsos.
The wings of ostriches, emus, and other flightless birds are vestigial; they are remnants of their flying ancestors' wings.
The eyes of certain cavefish and salamanders are vestigial, as they no longer allow the organism to see, and are remnants of their ancestors' functional eyes.
Boas and replace.pys have vestigial pelvis remanents which are externally visible as two small anal spurs on each side of the cloaca.  These spurs are sometimes used in copulation, but are not essential, as no colubroid snake (the vast majority of species) possesses these remnants.  Furthermore, in most snakes the left lung is greatly reduced or absent.  Amphisbaenians, which independently evolved limblessness, also retain vestiges of the pelvis as well as the pectoral girdle, and have lost their right lung.
Crabs have small tails tucked between their rear legs that are probably vestigial, as they are no longer in use. The working version of these tails can be found in their close crustacean relative, the lobster.
Certain species of moths (for example the Gypsy moth) have females that, although flightless, still carry small wings. These wings have no use, and are vestigial to the versions in species whose females can fly.
The fruit fly can be bred in high school experiments to produce off-spring with vestigial wings, to better understand basic genetics in biology.

### Humans
Human vestigiality is related to human evolution, and includes a variety of characters occurring in the human species. Many of these are also vestigial in other primates and related animals. The relative usefulness of these characters is a subject of debate. Structures that have been or still are considered vestigial no longer include the vermiform appendix, which produces good bacteria. Darwin, Charles (1871). The Descent of Man, and Selection in Relation to Sex. John Murray: London. the coccyx, or tailbone (a remnant of a lost tail); the plica semilunaris on the inside corner of the eye (a remnant of the nictitating membrane); and, as pictured, muscles in the ear and other parts of the body.
Humans also bear some vestigial behaviors and reflexes. The formation of goose bumps in humans under stress is a vestigial reflex; its function in human ancestors was to raise the body's hair, making the ancestor appear larger and scaring off predators. Raising the hair is also used to trap an extra layer of air, keeping an animal warm. This reflex formation of goosebumps when cold is not vestigial in humans, but the reflex to form them under stress is. Infants are also able to support their own weight while hanging from a rod, responding to certain tacticle stimuli. An ancestral primate would have had sufficient body hair for an infant to cling to, allowing its mother to escape from danger, such as climbing up a tree in the presence of a predator.
There are also vestigial molecular structures in humans, which are no longer in use but may indicate common ancestry with other species. One example of this is L-gulonolactone oxidase, a gene, that is functional in most other mammals, which produces a enzyme that can make vitamin C. A mutation inactivated the gene in an ancestor of the current group of primates, and it now remains in the human genome as a vestigial sequence called a pseudogene.

## Plants and other organisms
Vestigial structures are not only found in animals; plants also are known to have vestigial parts. Dandelions and other asexually reproducing plants produce unneeded flower petals. These petals were once used to attract pollinating insects, but are now no longer needed.