The main endogenous pacemaker for the circadian rhythm is the suprachiasmatic nucleus (SCN), part of the hypothalamus, which acts as an internal body clock to keep the body on an approximate 24 hour sleep-waking cycle. It is sensitive to light and regulates the pineal gland, which secretes melatonin - a hormone which encourages sleep. When there is less light, more melatonin is produced. When there is more light, levels are reduced and waking occurs.