Attractor finding algorithm