runing d2D count, not finish pseudo-code