Rewrote the 'fractal' part of the algorithm.