The fundamental nature of mental phenomena such as perception, learning and memory is one of the remaining scientific mysteries. Since the neuroanatomy of mammalian nervous systems is exceedingly complex and incompletely characterized, it is difficult to understand mechanistically how the human brain works at the level of molecules and cells. However, in simpler organisms like the nematode C. elegans, obtaining a reductionist understanding of nervous system function and behaviour is a tractable problem. Aspects of nervous system function in which we are investigating in C. elegans include mechanosensation: how do neurons sense stimuli such as touch and pain, and how do sensory circuits integrate and process this information. We are also interested in behavioural states: how do contextual cues such as satiety and the presence of food influence behaviour through defined neural circuits, and what roles do molecules like dopamine, serotonin and neuropeptides play in these processes.