The worm arose out of a dissatisfaction with the way the snail moved. The snails do not move using the simple harmonic motion(SHM) that I used for them but worms do. So I reused the SHM technique from the snail to produce a simple worm.
However, the elongation and contraction looked very artificial to me so I replaced the SHM motion with a longditudinal wave motion. I think that this makes the worm look much more organic.
I'm still not happy that the worm motion backslides at certain times and will look into fixing this later.