Restoration of function after brain injury