how the brain and legs are connected