dots
dots
rerewriting for 2d rects