How a caterpillar grows into a butterfly