Sleep is an altered state where people become relatively unaware of external stimulation. There are two main theories for why we sleep - the evolutionary theory which suggests it protects animals by keeping them safe at night, and the recuperative theory which says it conserves energy and allows the body to restore tissues depleted during waking hours. The circadian rhythm, an internally generated sleep-wake cycle connected to the 24-hour period of the earth's rotation, influences when we sleep at night. The amount of sleep needed decreases with age, from 20 hours for infants to 6 hours for elderly adults. Missing sleep can negatively impact both the body and brain by weakening the immune system, causing mood issues and decreased cognitive performance.