It consists of a ventral nerve cord , with one ganglion in each segment , and an anterior nerve ring surrounding the pharynx . The nervous system consists of a ventral nerve cord , with one ganglion in each segment , and an anterior nerve ring surrounding the pharynx .