private CalcState testPoints(CalcState state, Point p2, Point p3) {
        double bestDist = state.bestDist;
        Triangle bestTriangle = null;
        int[] rgba = new int[4];
        for (int r = 0; r <= conf.colorSteps; r++) {
            rgba[0] = expandColor(r);
            for (int g = 0; g <= conf.colorSteps; g++) {
                rgba[1] = expandColor(g);
                for (int b = 0; b <= conf.colorSteps; b++) {
                    rgba[2] = expandColor(b);
                    for (int a = 0; a <= conf.alphaSteps; a++) {
                        //trianglesTested++;
                        rgba[3] = expandColor(a);
                        Triangle t = new Triangle(rgba, state.p1, p2, p3);

                        Picture tmpPic = new Picture(state.p.getData(), state.p.getWidth(), state.p.getHeight());

                        Square dirty = dirty(state.p1, p2, p3);
                        double dirtyDistanceBefore = state.p.distance(conf.pic, dirty);

                        tmpPic.addTriangle(t);
                        double dirtyDistanceAfter = tmpPic.distance(conf.pic, dirty);

                        double distance = state.pDist - (dirtyDistanceBefore - dirtyDistanceAfter);
                        
                        if (distance < bestDist) {
                            bestTriangle = new Triangle(rgba.clone(), state.p1, p2, p3);
                            bestDist = distance;
                        }
                    }
                }
            }
        }
        return new CalcState(state.p, state.pDist, state.triangleNumber, state.point1, state.p1, bestDist, bestTriangle);
    }