(A) Roundworms have been trying to escape from predators for millions of years. This schematic, based on analysis of a piece of amber that is about 100 million years old, shows a worm being trapped by a carnivorous fungus (Schmidt et al., 2007). (B) When a worm encounters an unpleasant stimulus (red flash, top), it escapes by backing away. Subsequently it starts to either move forward again (top right) or to turn and move in a new direction (bottom right). Interactions between the neural modules that control these three types of motion result in flexible outcomes. Mutual inhibition (red flat-ended arrows) between the reversal module and the forward module explains why the rate of reverse-forward transitions does not change with the length of the reversal. The relationship between the reversal module and the turning module is more complex as it involves both feedforward and feedback inhibitions, (blue flat-ended arrows) and feedforward excitation (brown zig-zag line). Moreover, the work of Wang et al. suggests that the feedforward inhibition from the reversal module to the turning module weakens with time (shown here with fading), thereby suggesting how longer reversals are more likely to be followed by turns.