Modified algorithm for creating sample table -- unfortunately, not working -- getting sample impoverishment.