Control mechanism suggested from behavioral experiments. Either "walking" or "swimming" mode can be selected at each part. When a "swimming" signal comes from the brain, it is sent posteriorly, and "swimming" mode is selected at each body part. However, it is overridden by "walking" mode at the point where the leg contacts the ground. Then, "walking" signal is sent hereafter.