implemented flocking