function box = make_box3(points)
eps=10^-2;
dim=2;

N=size(points,1);
num_of_points=round(N^(1/dim));


range=min((max(points)-min(points)),[25 30])';
%range=min(3*median(points-ones(N,1)*min(points),1)',range);

box=zeros(N,dim);
pointer=max(min(points),eps);
step=range/(num_of_points-1);
jump=[1 num_of_points ];
for i=1:N
    for k=1:dim
        box(i,k)=pointer(k)+step(k)*mod(floor((i-1)/jump(k)),num_of_points);
    end
end  

%plot(box(:,1), box(:,2),'b.' ); hold on; plot(meanval(:,1), meanval(:,2), 'g+' );plot(points(:,1), points(:,2), 'r.' ); hold off
end