script to restrain motion of bacterium