the cortex controls what 3 main things?