Added attractor count code