A fundamental question in neurobiology concerns how the nervous system and genes generate behavior. The complexity of the mammalian nervous systems poses an immense challenge to address this question in mammals. We thus take a reductionist approach by focusing on the nematode C. elegans, a genetic model organism with a small but very well characterized nervous system. Specifically, we are interested in understanding how sensory inputs are perceived by the nervous system, how neural circuits process information to generate behavior, and how genes and drugs of abuse regulate these processes. To do so, we take a multidisciplinary approach combining molecular genetics, behavioral analysis, functional imaging, and electrophysiology.