Organize the code to expose the Flocking function