The nervous system is composed of the central nervous system (CNS; brain and spinal cord) and peripheral nervous system (PNS). The CNS processes sensory information and controls thoughts, emotions, and memories. The PNS consists of nerves, ganglia, and sensory receptors and regulates involuntary functions. Communication between neurons occurs at synapses, either electrically via gap junctions or chemically via neurotransmitters. This allows signals to be transmitted that control functions like movement, digestion, and heart rate.