Fractal algorithm and program design