E. Coli (and many other bacteria) rely heavily upon chemotaxis in order to find areas of food and keep out of areas of harmful substances. One of the important tricks involved in this is the ability to "compare" the current concentration of attractant/repellent to the previous concentration. This is achieved by adapting to the response - as the concentration outside the cell increases (in the case of attractants) or decreases (in the case of repellents), the receptors are methylated in order to return them to their normal level of activity. Therefore, a signal only occurs if the bacterium is swimming either up or down a gradient. If the concentration is not going in the direction that the bacterium "wants" it to go in, it tumbles around randomly until it happens to be going in the right direction again (towards attractants, away from repellents) which triggers the signal again and causes the bacterium to swim in a straight line.