set array using sample: is there a bug in "sample"?