E-mail the story: Worms do calculus to find meals or avoid unpleasantness