How does a nervous system control animal behavior? While models of behavior and neural computation exist, investigating the connection experimentally is challenging in even the simplest organisms. It is only recently that tools have become available to image the behavior and neural dynamics simultaneously in the roundworm C. elegans. Its small nervous system with only 302 neurons and stereotyped behaviors allow us to probe how well simple models perform in predicting behavior from neural dynamics alone. We use a suite of microscopy tools and a calcium-sensitive fluorescent protein to image the activity of a large number of neurons in the animals brain during locomotion. Using a sparse linear model, we predict forward and backward velocity as well as turns and turn direction from neural activity. Using our model and the animals neural activity, we can predict the worms posture for up to 10 seconds. I will discuss the implications for understanding how neural networks encode information and how this information could be used in coordinating complex motor tasks.