CSF, which the choroid plexus produces, circulates from the ventricles to the subarachnoid space. Along with the meningeal membranes, CSF protects the brain and spinal cord. Its other function is to regulate extracellular environments. It collects harmful substances and waste products that result from cellular metabolic activities. Inadequate drainage of the CSF results in excessive accumulation of CSF followed by increased intracranial pressure and hydrocephalus. Hydrocephalus can be treated by surgically implanting a shunt. However, if not adequately treated, the increased intracranial pressure that accompanies hydrocephalus enlarges the ventricular cavity and causes irreparable brain damage.