Added flocking code.