Answer the following question given this paragraph: 

The thalamus acts as a gateway to and from the cortex. It receives sensory and motor inputs from the body and also receives feedback from the cortex. This feedback mechanism can modulate conscious awareness of sensory and motor inputs depending on the attention and arousal state of the animal. The thalamus helps regulate consciousness, arousal, and sleep states. Below the thalamus is the hypothalamus. The hypothalamus controls the endocrine system by sending signals to the pituitary gland. Among other functions, the hypothalamus is the body’s thermostat—it makes sure the body temperature is kept at appropriate levels. Neurons within the hypothalamus also regulate circadian rhythms, sometimes called sleep cycles. The limbic system is a connected set of structures that regulates emotion, as well as behaviors related to fear and motivation. It plays a role in memory formation and includes parts of the thalamus and hypothalamus as well as the hippocampus. One important structure within the limbic system is a temporal lobe structure called the amygdala. The two amygdala (one on each side) are important both for the sensation of fear and for recognizing fearful faces. The cerebellum (cerebellum = “little brain”) sits at the base of the brain on top of the brainstem. The cerebellum controls balance and aids in coordinating movement and learning new motor tasks. The cerebellum of birds is large compared to other vertebrates because of the coordination required by flight. The brainstem connects the rest of the brain with the spinal cord and regulates some of the most important and basic functions of the nervous system including breathing, swallowing, digestion, sleeping, walking, and sensory and motor information integration.


Q: The thalamus acts as a gateway to and from what?


A:
cortex