Three masses of gray matter, collectively termed the basal ganglia, are located deep within each cerebral hemisphere. They receive input from the cerebral cortex and provide output back to motor parts of the cortex. They also control subconscious contractions of skeletal muscles (e.g., arm swings while walking, laughing in response to a joke) and may act with the limbic system to regulate emotional behaviors. (Tortora, Gerard J. and Sandra Reynolds Grabowski. Principles of Anatomy and Physiology, 10th Edition. p 469-471. NY:John Wiley & Sons, Inc., 2003.)