function loopprint(values,m,qs)
% This function allows printing of a table of values into an
% SG-type arrangement.

if(m ~= 0)
  for i = 1:3
    newqs = [fi(qs(1,:),qs(i,:)); fi(qs(2,:),qs(i,:)); fi(qs(3,:),qs(i,:))] ;
    loopprint(values((i-1)*3^m+1:i*3^m),m-1,newqs) ;
  end

else
  ps = findps(qs) ;
  for i = 1:3
    text(ps(i,1),ps(i,2),num2str(values(i)),'FontSize',8) ;
  end
  
end