update swarm.js. red detection and control