Pain serves an important protective function by alerting us to potential harm through the stimulation of pain receptors by damaging stimuli. Pain signals are transmitted along axons of varying thickness to the spinal cord, where neurotransmitters like glutamate and substance P are released to send the signals to different areas of the brain involved in sensory processing and the emotional experience of pain, such as the thalamus, somatosensory cortex, amygdala, and cingulate cortex. The brain is able to determine the location and intensity of various painful sensations.