The evolution of the caterpillar