modified flocking algorithm