@Override
    public double[] calculateFractal3DWithPeriodicity(Complex pixel) {

        iterations = 0;

        check = 3;
        check_counter = 0;

        update = 10;
        update_counter = 0;

        period = new Complex();

        Complex tempz = new Complex(pertur_val.getPixel(init_val.getPixel(pixel)));

        Complex[] complex = new Complex[2];
        complex[0] = tempz;//z
        complex[1] = new Complex(pixel);//c

        Complex zold = new Complex();

        if(parser.foundS()) {
            parser.setSvalue(new Complex(complex[0]));
        }

        if(parser2.foundS()) {
            parser2.setSvalue(new Complex(complex[0]));
        }

        if(parser.foundP()) {
            parser.setPvalue(new Complex());
        }

        if(parser2.foundP()) {
            parser2.setPvalue(new Complex());
        }

        double temp;

        for(; iterations < max_iterations; iterations++) {
            if(bailout_algorithm.escaped(complex[0], zold)) {
                Object[] object = {iterations, complex[0], zold};
                temp = out_color_algorithm.getResult(object);
                double[] array = {Math.abs(temp) - 100800, temp};
                return array;
            }
            zold.assign(complex[0]);
            function(complex);

            if(parser.foundP()) {
                parser.setPvalue(new Complex(zold));
            }

            if(parser2.foundP()) {
                parser2.setPvalue(new Complex(zold));
            }

            if(periodicityCheck(complex[0])) {
                double[] array = {max_iterations, max_iterations};
                return array;
            }

        }

        double[] array = {max_iterations, max_iterations};
        return array;

    }