The memory usage of the bond detection algorithm used to scale as N^2. Now it scales as N.