much faster version of attractor script