fixed IA in swarm
misc swarm edits
re-arranged: each fxn now has its own script